1
class Solution:
2
def peopleIndexes(self, favoriteCompanies: List[List[str]]) -> List[int]:
3

4
F = favoriteCompanies
5
ans = []
6

7
seen = set()
8

9
for i in range(len(F)):
10
for j in range(i + 1, len(F)):
11
st1 = set(F[i])
12
st2 = set(F[j])
13
if st1.intersection(st2) == st1:
14
seen.add(i)
15
if st2.intersection(st1) == st2:
16
seen.add(j)
17

18
ans = []
19
for i in range(len(F)):
20
if i in seen:
21
continue
22
ans.append(i)
23

24
return ans

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0