Very simple solution in O(1) for add contains and remove
I use more memory to get O(1) mean time for add contains and remove \n\nclass MyHashSet:\n\n    def __init__(self):\n        self.v = [False] * (10**6 +1)\n\n  
I use more memory to get O(1) mean time for add contains and remove \n```\nclass MyHashSet:\n\n    def __init__(self):\n        self.v = [False] * (10**6 +1)\n\n    def add(self, key: int) -> None:\n        self.v[key] = True\n\n    def remove(self, key: int) -> None:\n        self.v[key] = False \n\n    def contains(self, key: int) -> bool:\n        return self.v[key]\n\n# Your MyHashSet object will be instantiated and called as such:\n# obj = MyHashSet()\n# obj.add(key)\n# obj.remove(key)\n# param_3 = obj.contains(key)\n```\nPlease upvote if you like it
['Python', 'Python3']