fork download
  1. class MyHashSet:
  2. myset = set()
  3. def __init__(self):
  4. self.myset = set()
  5. def add(self, key: int) -> None:
  6. return self.myset.add(key)
  7.  
  8. def remove(self, key: int) -> None:
  9. return self.myset.discard(key)
  10.  
  11. def contains(self, key: int) -> bool:
  12. return (key in self.myset)
  13.  
  14.  
Success #stdin #stdout 0.11s 14196KB
stdin
Standard input is empty
stdout
Standard output is empty