Java Concise Solution 24ms
python reference: https://leetcode.com/problems/smallest-sufficient-team/discuss/334572/Python-DP-Solution\n\nclass Solution {\n    public int[] smallestSuffici
python reference: https://leetcode.com/problems/smallest-sufficient-team/discuss/334572/Python-DP-Solution\n```\nclass Solution {\n    public int[] smallestSufficientTeam(String[] req_skills, List<List<String>> people) {\n        int ns = req_skills.length, np = people.size();\n        HashMap<String, Integer> map = new HashMap<>();\n        for (int i = 0; i < ns; ++i) map.put(req_skills[i], i);\n        List<Integer>[] suff = new List[1 << ns];\n        suff[0] = new ArrayList<>();\n        for (int i = 0; i < np; ++i) {\n            int skill = 0;\n            for (String s : people.get(i)) skill |= (1 << map.get(s));\n            for (int prev = 0; prev < suff.length; ++prev) {\n                if (suff[prev] == null) continue;\n                int comb = prev | skill;\n                if (suff[comb] == null || suff[prev].size() + 1 < suff[comb].size()) {\n                    suff[comb] = new ArrayList<>(suff[prev]);\n                    suff[comb].add(i);\n                }\n            }\n        }\n        List<Integer> res = suff[(1 << ns) - 1];\n        int[] arr = new int[res.size()];\n        for (int i = 0; i < arr.length; ++i) arr[i] = res.get(i);\n        return arr;\n    }\n}\n\n```
[]