Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (10 sloc) 300 Bytes
from hash_map import HashMap
class HashSet:
def __init__(self):
self.backing_map = HashMap()
def __len__(self):
return len(self.backing_map)
def put(self, value):
self.backing_map.put(value, True)
def contains(self, value):
return self.backing_map.get(value) is not None
You can’t perform that action at this time.