Java||bit-manipulation||EASY TO UNDERSTAND||BACKTRACKING
\nclass Solution {\n    ArrayList<Integer>ans=new ArrayList<>();\n    int helper(int ind,int []person, int nSkill,ArrayList<Integer>sol,int sMask,int dp[][],int
```\nclass Solution {\n    ArrayList<Integer>ans=new ArrayList<>();\n    int helper(int ind,int []person, int nSkill,ArrayList<Integer>sol,int sMask,int dp[][],int count){\n        //System.out.println(ind+" "+sMask);\n        if(sMask==(1<<nSkill)-1){\n                if(ans.size()==0||sol.size()<ans.size()){\n                    ans=new ArrayList<>(sol);\n                    return sol.size();\n                }\n            }\n        if(ind==person.length){\n            \n            return Integer.MAX_VALUE ;\n        }\n        if(dp[sMask][count]!=0){\n            \n            return dp[sMask][count];\n        }\n        //take\n        sol.add(ind);\n        count++;\n        int take=helper(ind+1,person,nSkill,sol,sMask|person[ind],dp,count);\n        sol.remove(sol.size()-1);\n        count--;\n        int notTake=helper(ind+1,person,nSkill,sol,sMask,dp,count);\n        \n        dp[sMask][count]=Math.min(take,notTake);\n        return dp[sMask][count];\n    }\n    public int[] smallestSufficientTeam(String[] req_skills, List<List<String>> people) {\n        HashMap<String,Integer>hm=new HashMap<>();\n        for(int i=0;i<req_skills.length;i++){\n            hm.put(req_skills[i],i);\n        }\n        int person[]=new int[people.size()];\n        for(int i=0;i<people.size();i++){\n            for(int j=0;j<people.get(i).size();j++){\n                String skill=people.get(i).get(j);\n                int a=hm.get(skill);\n                \n                person[i]=person[i]|(1<<a);\n                //System.out.println(i+"p "+person[i]);\n            }\n            \n        }\n        ArrayList<Integer>sol=new ArrayList<>();\n        int len=(int)Math.pow(2,req_skills.length)+1;\n        int dp[][]=new int[len][person.length+1];\n        helper(0,person,req_skills.length,sol,0,dp,0);\n        int answer[]=new int [ans.size()];\n        for(int i=0;i<ans.size();i++){\n            answer[i]=ans.get(i);\n        }\n         return answer;\n    }\n}\n```
['Java']