프로그래밍/LeetCode
[LeetCode][Python3] 705. Design HashSet
snoopybox
2018. 9. 12. 22:17
Problem :
https://leetcode.com/problems/design-hashset/description/
My Solution :
class MyHashSet:
def __init__(self):
self.hset = [False] * 1000001
def add(self, key):
self.hset[key] = True
def remove(self, key):
self.hset[key] = False
def contains(self, key):
return self.hset[key]