Tap here to switch tabs
Problem
Submissions

Problem: People Whose Favorite Companies Are Not a Subset

Try to solve the People Whose Favorite Companies Are Not a Subset problem.

Statement

Given an array favoriteCompanies where favoriteCompanies[i] is the list of favorite companies for the ii-th person (indexed from 00), return the indices of people whose list of favorite companies is not a subset of any other person’s list of favorite companies.

The returned indices must be sorted in increasing order.

Constraints:

  • 1≤1 \leq favoriteCompanies.length ≤100\leq 100

  • 1≤1 \leq favoriteCompanies[i].length ≤500\leq 500

  • 1≤1 \leq favoriteCompanies[i][j].length ≤20\leq 20

  • All strings in favoriteCompanies[i] are distinct.

  • All lists of favorite companies are distinct, meaning if each list is sorted alphabetically, favoriteCompanies[i] != favoriteCompanies[j] for all i≠ji \neq j.

  • All strings consist of lowercase English letters only.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: People Whose Favorite Companies Are Not a Subset

Try to solve the People Whose Favorite Companies Are Not a Subset problem.

Statement

Given an array favoriteCompanies where favoriteCompanies[i] is the list of favorite companies for the ii-th person (indexed from 00), return the indices of people whose list of favorite companies is not a subset of any other person’s list of favorite companies.

The returned indices must be sorted in increasing order.

Constraints:

  • 1≤1 \leq favoriteCompanies.length ≤100\leq 100

  • 1≤1 \leq favoriteCompanies[i].length ≤500\leq 500

  • 1≤1 \leq favoriteCompanies[i][j].length ≤20\leq 20

  • All strings in favoriteCompanies[i] are distinct.

  • All lists of favorite companies are distinct, meaning if each list is sorted alphabetically, favoriteCompanies[i] != favoriteCompanies[j] for all i≠ji \neq j.

  • All strings consist of lowercase English letters only.