We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3709a97 commit 1e6a841Copy full SHA for 1e6a841
codes/python/chapter_hashing/array_hash_map.py
@@ -26,7 +26,7 @@ def hash_func(self, key: int) -> int:
26
index = key % 100
27
return index
28
29
- def get(self, key: int) -> str:
+ def get(self, key: int) -> str | None:
30
"""查询操作"""
31
index: int = self.hash_func(key)
32
pair: Pair = self.buckets[index]
@@ -35,7 +35,7 @@ def get(self, key: int) -> str:
35
return pair.val
36
37
def put(self, key: int, val: str):
38
- """添加操作"""
+ """添加和更新操作"""
39
pair = Pair(key, val)
40
41
self.buckets[index] = pair
0 commit comments