python DP, with detailed explanation
use bit representation of all possible tasks, \n  eg. Input: req_skills = ["java","nodejs","reactjs"]\n\n  000 task0 ()\n  100 task1 (Java)\n  010 task2 (Nodejs
- use bit representation of all possible tasks, \n  eg. Input: req_skills = ["java","nodejs","reactjs"]\n\n  000 task0 ()\n  100 task1 (Java)\n  010 task2 (Nodejs)\n  110 task3 (Java, Nodejs)\n  ...\n  111 taskn (Java, nodejs, reactjs) \n  The last task (or task we want) is one with all the skills.\n\n- How many tasks do we have? \n  111  = 2^3 - 1\n\n- use bitwise to represent a person\'s skills set.\n  For Example:\n  people = [["java"],["nodejs"],["nodejs","reactjs"]]\n    person0 ["java"] => 100\n    person2 ["nodejs", "rectjs"] => 011\n\n\n- use a dp (matrix or dic) to cache the states.\ndp[person_i][task_j] = the smallest team to complete task_j up to person_i.\n\nuse person_i\'s skill, do a bitwise or opration with every task_j => gets a new_task_k,\nThat means with person_i\'s skills, we can complete a new task_k.\nWe do that for every person, for every task.\nperson    Task   new_task\n100     | 011 => 111\n010     | 011 => 011\n\nHow do we update dp? \n1) base case:\nFor task 0 (or 000 in example above), it\'s []. b/c we don\'t need anyone to complete that.\n\n2) general case:\nif with the addition person_i, (with existing task_j, after bitwise or), we can complete task_k,\nthen compare the length of current team with the new team.\n\n\nTime Complexity:\nO(P * (2^N))\nP = num of people\nN = num of required_skills\n\n```\ndef smallest_sufficient_team(required_skills: List[str],\n                             people_skills: List[List[str]]) -> List[int]:\n  dp = {0: []}\n\n  # map {skill_str_name : index_in_bit}\n  skill_to_index_map = {\n      skill: index for index, skill in enumerate(required_skills)\n  }\n\n  for index in range(len(people_skills)):\n    person_skills_bit_rep = 0\n    for skill in people_skills[index]:\n      person_skills_bit_rep |= (1 << skill_to_index_map[skill])\n    tasks = list(dp.keys())\n\n    for task_i in tasks:\n      new_task = (task_i | person_skills_bit_rep)\n      if (new_task not in dp) or (len(dp[new_task]) > len(dp[task_i]) + 1):\n        dp[new_task] = dp[task_i] + [index]\n\n  return dp[(1 << len(required_skills)) - 1]\n```
[]