Python Hard
\nclass Solution:\n    def smallestSufficientTeam(self, req_skills: List[str], people: List[List[str]]) -> List[int]:\n\n        d = defaultdict(int)\n        N
```\nclass Solution:\n    def smallestSufficientTeam(self, req_skills: List[str], people: List[List[str]]) -> List[int]:\n\n        d = defaultdict(int)\n        N = len(req_skills)\n        P = len(people)\n\n        for i, skill in enumerate(req_skills):\n            d[skill] = 1 << i\n\n        people_skills = []\n\n        for p_list in people:\n            \n            skills = 0\n\n            for s in p_list:\n                skills |= d[s]\n\n            people_skills.append(skills)\n\n        cache = {}\n\n        def calc(index, mask):\n\n            if (index, mask) in cache:\n                return cache[(index, mask)]\n\n            if mask == 0:\n                return []\n\n            if index == P:\n                return [0] * 100\n\n            best = min(calc(index + 1, mask), [index] + calc(index + 1, mask & ~people_skills[index]), key=len)\n\n            cache[(index, mask)] = best\n\n            return best\n\n\n        return calc(0, (1 << N) - 1)\n\n\n\n\n\n        \n\n\n     \n```
['Python3']