am i stupid for thinking bfs? [python 3 bfs solution]
Intuition\n Describe your first thoughts on how to solve this problem. \ni thought it was bfs because it said minimum number of people. \n\n# Approach\n Describ
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\ni thought it was bfs because it said minimum number of people. \n\n# Approach\n<!-- Describe your approach to solving the problem. -->\ni started off with a convert function, traversed the graph using a bfs function and marking things visited using a bitmask\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def smallestSufficientTeam(self, req_skills: List[str], people: List[List[str]]) -> List[int]:\n        convert = {key:idx for idx, key in enumerate(req_skills)}\n\n        n, m = len(req_skills), len(people)\n        end_mask = 2 ** n - 1\n        visit = set()\n\n        for idx, i in enumerate(people):\n            temp = 0\n            for j in range(len(i)):\n                temp += (1 << convert[i[j]])\n            people[idx] = temp\n        \n        q = [(0, [])]\n        while q:\n            mask, arr = q.pop()\n            if mask == end_mask:\n                return arr\n            for idx, skill in enumerate(people):\n                new_mask = mask | skill\n                if new_mask not in visit:\n                    visit.add(new_mask)\n                    q.insert(0, (new_mask, arr + [idx]))\n\n```
['Breadth-First Search', 'Bitmask', 'Python3']