[Python3] top-down dp
\n\nclass Solution:\n    def smallestSufficientTeam(self, req_skills: List[str], people: List[List[str]]) -> List[int]:\n        mp = {skill : i for i, skill in
\n```\nclass Solution:\n    def smallestSufficientTeam(self, req_skills: List[str], people: List[List[str]]) -> List[int]:\n        mp = {skill : i for i, skill in enumerate(req_skills)} # digitized skills\n        \n        cand = []\n        for skills in people: \n            val = 0\n            for skill in skills: \n                val |= 1 << mp[skill] # digitized skill\n            cand.append(val)\n        \n        @cache\n        def fn(i, mask): \n            """Return smallest sufficient team of people[i:] for skills in mask."""\n            if mask == 0: return []\n            if i == len(people): return [0]*100 # impossible\n            if not (mask & cand[i]): return fn(i+1, mask)\n            return min(fn(i+1, mask), [i] + fn(i+1, mask & ~cand[i]), key=len)\n        \n        return fn(0, (1 << len(req_skills)) - 1)\n```
['Python3']