3
std::vector<int> smallestSufficientTeam(std::vector<std::string> &req_skills,4
std::vector<std::vector<std::string>> &people) {5
int n = req_skills.size();8
std::unordered_map<std::string, int> skillToIndex;9
for (int i = 0; i < n; i++) {10
skillToIndex[req_skills[i]] = i;13
std::vector<int> arr(m, 0);14
for (int i = 0; i < m; i++) {15
std::vector<std::string> &personSkills = people[i];17
for (const std::string &skill : personSkills) {18
val |= 1 << skillToIndex[skill];23
std::vector<bool> banned(m, false);24
for (int i = 0; i < m; i++) {25
for (int j = i + 1; j < m; j++) {26
int val = arr[i] | arr[j];29
} else if (val == arr[j]) {36
helper(0, n, arr, std::vector<int>(), banned, ans);42
void helper(int cur, int n, const std::vector<int> &arr, std::vector<int> team,43
const std::vector<bool> &banned, std::vector<int> &ans) {44
if (cur == (1 << n) - 1) {45
if (ans.empty() || team.size() < ans.size()) {51
if (!ans.empty() && team.size() >= ans.size()) {56
while (((cur >> zero) & 1) == 1) {60
for (int i = 0; i < arr.size(); i++) {65
if (((arr[i] >> zero) & 1) == 1) {67
helper(cur | arr[i], n, arr, team, banned, ans);