[C++] Beginner Understandable Code || SubOptimal but Easy
\nclass Solution {\npublic:\n    vector<int> res;\n    void helper(unordered_set<string> &skillset, int curr, vector<vector<string>>& people, unordered_set<stri
```\nclass Solution {\npublic:\n    vector<int> res;\n    void helper(unordered_set<string> &skillset, int curr, vector<vector<string>>& people, unordered_set<string> currSkill, vector<int> temp){\n        if(skillset==currSkill){\n            if(res.size()==0){\n                res=temp;\n            }\n            else if(temp.size()<res.size()){\n                res=temp;\n            }\n            return;\n        }\n        for(int i=curr;i<people.size();i++){\n            vector<string> teamSkill=people[i];\n            unordered_set<string> bk=currSkill;\n            for(auto sk: teamSkill){\n                currSkill.insert(sk);\n            }\n            temp.push_back(i);\n            helper(skillset,i+1,people,currSkill,temp);\n            currSkill=bk;\n            temp.pop_back();\n        }\n    }\n    vector<int> smallestSufficientTeam(vector<string>& req_skills, vector<vector<string>>& people) {\n        unordered_set<string> skillset(req_skills.begin(),req_skills.end());\n        helper(skillset,0,people,{},{});\n        return res;\n    }\n}; //simple brute force but TLE\n```\n\n```\nclass Solution {\npublic:\n    vector<int> res;\n    int dp[(1<<16)+1][65];\n    map<int,unordered_map<string,int>> m;\n    int mnTeam=INT_MAX;\n    \n    int solve(int mask, vector<string> &req, vector<vector<string>> &people, vector<int> &temp, int curr){\n        int n=req.size();\n        if(mask==(1<<n)-1){\n            if(mnTeam>temp.size()){\n                mnTeam=temp.size();\n                res=temp;\n            }\n            return 0;\n        }\n        int count=temp.size();\n        if(dp[mask][count]!=-1){\n            return dp[mask][count];\n        }\n        int ans=INT_MAX/2;\n        for(int i=curr;i<people.size();i++){\n            if(people[i].size()==0){\n                continue; //optimization 1\n            }\n            int nm=mask;\n            for(int j=0;j<n;j++){\n                if((nm & (1<<j))==0 && m[i][req[j]]==1){   // if this bit is not set, i.e. this skill is not yet achieved and if this guy has this skill, take in account for this skill\n                    nm=nm | (1<<j);\n                }\n            }\n            if(nm!=mask && count+1<mnTeam){ //optimization 2, we want minimum guys right, so if we push one more guy and if that increases the count of guys we already had for minimum team, do not recurse for this \n                temp.push_back(i);\n                ans=min(ans,1+solve(nm,req,people,temp,i+1));\n                temp.pop_back();\n            }\n        }   \n        return dp[mask][count]=ans ; \n    }\n    vector<int> smallestSufficientTeam(vector<string>& req_skills, vector<vector<string>>& people) {\n        int n=req_skills.size();\n        int mask=0;\n        for(int i=0;i<people.size();i++){\n            for(int j=0;j<people[i].size();j++){\n                m[i][people[i][j]]=1;\n            }\n        }\n        vector<int> temp;\n        memset(dp,-1,sizeof(dp));\n        cout<<solve(mask,req_skills,people,temp,0);\n        return res;\n    }\n};\n```
['Dynamic Programming', 'Backtracking', 'Bit Manipulation', 'Tree', 'Depth-First Search', 'C', 'Bitmask']