Python hash set with trivial hash function
python\nclass MyHashSet:\n    def __init__(self):\n        self.size = 10000\n        self.buckets = [[] for _ in range(self.size)]\n\n    def add(self, key):\n
```python\nclass MyHashSet:\n    def __init__(self):\n        self.size = 10000\n        self.buckets = [[] for _ in range(self.size)]\n\n    def add(self, key):\n        bucket, idx = self._index(key)\n        if idx >= 0:\n            return\n        bucket.append(key)\n\n    def remove(self, key):\n        bucket, idx = self._index(key)\n        if idx < 0:\n            return\n        bucket.remove(key)\n\n    def contains(self, key):\n        _, idx = self._index(key)\n        return idx >= 0\n\n    def _hash(self, key):\n        return key % self.size\n\n    def _index(self, key):\n        hash = self._hash(key)\n        bucket = self.buckets[hash]\n        for i, k in enumerate(bucket):\n            if k == key:\n                return bucket, i\n        return bucket, -1\n```\n
[]