Explained with Comments JS
Code\n\nfunction smallestSufficientTeam(req_skills, people) {\n  const n = req_skills.length; // Number of required skills\n  const m = people.length; // Number
# Code\n```\nfunction smallestSufficientTeam(req_skills, people) {\n  const n = req_skills.length; // Number of required skills\n  const m = people.length; // Number of people\n  \n  const skill_index = new Map(); // Map to store skill-to-index mapping\n  \n  // Populate the skill_index map with skill-to-index mapping\n  for (let i = 0; i < n; i++) {\n    skill_index.set(req_skills[i], i);\n  }\n  \n  const dp = new Array(1 << n); // Array to store the minimum team for each skills mask\n  dp[0] = []; // Base case: no skills required, so an empty team is sufficient\n  \n  // Iterate over each person and their skills\n  for (let i = 0; i < m; i++) {\n    let cur_skill = 0; // Current person\'s skills mask\n    \n    // Calculate the skills mask of the current person\n    for (let s of people[i]) {\n      cur_skill |= 1 << skill_index.get(s);\n    }\n    \n    // Update the dp array for all previous skills masks\n    for (let prev = 0; prev < dp.length; prev++) {\n      if (dp[prev] === undefined) continue; // Skip if previous skills mask is not possible\n      \n      let comb = prev | cur_skill; // Combined skills mask\n      \n      // Check if the new combined skills mask has a smaller team size\n      if (dp[comb] === undefined || dp[prev].length + 1 < dp[comb].length) {\n        dp[comb] = [...dp[prev], i]; // Update the team with the current person\n      }\n    }\n  }\n  \n  // Return the resulting team as an array of indices\n  return dp[(1 << n) - 1].map(i => i);\n}\n\n```
['Dynamic Programming', 'Bit Manipulation', 'Bitmask', 'JavaScript']