C++ DP memoization with Bitmasking solution...
\n\n# Code\n\nclass Solution {\npublic:\n    long long dp[1<<17];\n    long long int maxm=(1UL << 61)-1;\n    long long helper(unordered_map<string,int>&mp,vect
\n\n# Code\n```\nclass Solution {\npublic:\n    long long dp[1<<17];\n    long long int maxm=(1UL << 61)-1;\n    long long helper(unordered_map<string,int>&mp,vector<vector<string>>&people,int mask)\n    {\n        int sz=mp.size();\n        if(mask==((1<<sz)-1))\n        {\n            return 0ll;\n        }\n        if(dp[mask]!=-1)return dp[mask];\n        long long ans=maxm;\n        for(long long i=0;i<(int)people.size();i++)\n        {\n          \n            int newmask=mask;\n            long long curr=0;\n            for(int j=0;j<(int)people[i].size();j++)\n            {\n               \n                if(mp.count(people[i][j]))\n                {\n                    int idx=mp[people[i][j]];\n                    if((newmask & (1 <<idx ))==0)\n                    {newmask=(newmask | (1<<idx));}\n                }\n            }\n            if(newmask > mask)\n            {\n                curr=(curr | (1UL<<i));\n                curr|=helper(mp,people,newmask);\n                if(__builtin_popcountll(curr) < __builtin_popcountll(ans))          {\n                    ans=curr;\n                }\n                \n            }\n        }\n        return dp[mask]=ans;\n    }\n    vector<int> smallestSufficientTeam(vector<string>& req, vector<vector<string>>& people) \n    {\n        memset(dp,-1,sizeof(dp));\n        unordered_map<string,int>mp;\n        for(int i=0;i<(int)req.size();i++)\n        mp[req[i]]=i;\n        long long ans=helper(mp,people,0);\n        vector<int>res;\n        for(int i=0;i<=60;i++)\n        {\n            if(ans & (1UL << i))\n            res.push_back(i);\n        }\n        return res;\n    }\n};\n```
['Dynamic Programming', 'Bit Manipulation', 'Memoization', 'Bitmask', 'C++']