[LeetCode][Python3] 706. Design HashMap
2018. 9. 12. 21:48 |
프로그래밍/LeetCode
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랑 다를 바가 없다.
'프로그래밍 > LeetCode' 카테고리의 다른 글
[LeetCode][Python3] 53. Maximum Subarray (0) | 2018.09.21 |
---|---|
[LeetCode][Python3] 38. Count and Say (0) | 2018.09.21 |
[LeetCode][Python3] 665. Non-decreasing Array (0) | 2018.09.13 |
[LeetCode][Python3] 705. Design HashSet (0) | 2018.09.12 |
[LeetCode][Python3] 35. Search Insert Position (0) | 2018.09.12 |
[LeetCode][Python3] 28. Implement strStr() (0) | 2018.09.12 |
[LeetCode][Python3] 27. Remove Element (0) | 2018.09.11 |
[LeetCode][Python3] 26. Remove Duplicates from Sorted Array (0) | 2018.09.11 |
최근에 달린 댓글 최근에 달린 댓글