2
* @param {string[]} req_skills3
* @param {string[][]} people6
var smallestSufficientTeam = function (req_skills, people) {7
const skillIndexMap = new Map();9
req_skills.forEach((skill, index) => skillIndexMap.set(skill, index));11
const skillTeamMap = new Map([[0, []]]);13
people.forEach((skills, index) => {16
for (const skill of skills) {17
hisSkills |= 1 << skillIndexMap.get(skill);20
for (const [currSkill, team] of skillTeamMap) {21
const totalSkills = currSkill | hisSkills;23
if (totalSkills === currSkill) {28
!skillTeamMap.has(totalSkills) ||29
team.length + 1 < skillTeamMap.get(totalSkills).length31
skillTeamMap.set(totalSkills, [...team, index]);36
return skillTeamMap.get((1 << req_skills.length) - 1);