Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.05 KB

_1452. People Whose List of Favorite Companies Is Not a Subset of Another List.md

File metadata and controls

37 lines (25 loc) · 1.05 KB

All prompts are owned by LeetCode. To view the prompt, click the title link above.

Back to top


First completed : September 25, 2024

Last updated : September 25, 2024


Related Topics : Array, Hash Table, String

Acceptance Rate : 59.01 %


Solutions

Python

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)]