Python Solution Using set() Explained || Faster than 99.34%
Code\n\nclass MyHashSet(object):\n\n    def __init__(self):\n        self.hashSet = set([])\n\n    def add(self, key):\n        self.hashSet.add(key)\n\n    def
**Code**\n```\nclass MyHashSet(object):\n\n    def __init__(self):\n        self.hashSet = set([])\n\n    def add(self, key):\n        self.hashSet.add(key)\n\n    def remove(self, key):\n        if key in self.hashSet:\n            self.hashSet.remove(key)\n\n    def contains(self, key):\n        if key in self.hashSet:\n            return True\n        return False\n```\n**Explaination**\nThis solution works by initalizing the Hash Set as an attribute of the class in the __init__ function. \nI found that this was the easiest way to ensure that whenever the class is called that a Hash Set is created.\nThen I used the __.add()__ and __.remove()__ methods to add and remove keys from the set. \nNote that for the __remove()__ method I first checked if the key was in the set. \nThen for the contains function I simply returned true if the key was in the set and false otherwise.\n\n**Upvote is you found this helpful!**
['Array', 'Python']