All prompts are owned by LeetCode. To view the prompt, click the title link above.
First completed : September 25, 2024
Last updated : September 25, 2024
Related Topics : Array, Hash Table, String
Acceptance Rate : 59.01 %
class Solution:
def peopleIndexes(self, favoriteCompanies: List[List[str]]) -> List[int]:
favoriteCompanies = [set(x) for x in favoriteCompanies]
return [i for i, x in enumerate(favoriteCompanies)
if all(x == y
or not x.issubset(y)
for y in favoriteCompanies)]