프로그래밍/LeetCode
[LeetCode][Python3] 706. Design HashMap
snoopybox
2018. 9. 12. 21:48
Problem :
https://leetcode.com/problems/design-hashmap/description/
My Solution :
class MyHashMap:
def __init__(self):
self.map = [None] * 1000001
def put(self, key, value):
self.map[key] = value
def get(self, key):
item = self.map[key]
if item is None:
return -1
return item
def remove(self, key):
self.map[key] = None
Comment :
음... 이건 그냥 list랑 다를 바가 없다.