- Reference
- 체μ΄λ λ°©μμ μ΄ν΄νκΈ° λ무 νλ€μ΄μ μΌλ¨ μ§κΈμ μ΄ λ°©μμΌλ‘ νμλ€,,
Solution
class MyHashMap:
def __init__(self):
self.map = [-1 for _ in range(1000001)]
def put(self, key: int, value: int) -> None:
self.map[key] = value
def get(self, key: int) -> int:
return self.map[key]
def remove(self, key: int) -> None:
self.map[key] = -1
# Your MyHashMap object will be instantiated and called as such:
# obj = MyHashMap()
# obj.put(key,value)
# param_2 = obj.get(key)
# obj.remove(key)
Leave a comment