This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
list to Set: O(n) | |
Check if b in a: O(len(b)) | |
so the the time complexity will be O(2n + len(b)) : O(n) | |
""" | |
class Solution: | |
def isSubset(self, a, b): | |
return set(b).issubset(set(a)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |