mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-01 03:24:24 +08:00
Bug fixes and improvements (#1813)
* Sync zh and zh-hant version. * Add the Warp sponsor banner. * Update README with acknowledgments and Warp recommendation Added acknowledgments and a recommendation for the Warp terminal application. * Update README.md * Update links in README.md to use HTTPS * Sync zh and zh-hant versions. * Add special thanks for Warp spnsorship. * Use official warp image link.
This commit is contained in:
@ -26,7 +26,7 @@ class ArrayHashMap:
|
||||
index = key % 100
|
||||
return index
|
||||
|
||||
def get(self, key: int) -> str:
|
||||
def get(self, key: int) -> str | None:
|
||||
"""查詢操作"""
|
||||
index: int = self.hash_func(key)
|
||||
pair: Pair = self.buckets[index]
|
||||
@ -35,7 +35,7 @@ class ArrayHashMap:
|
||||
return pair.val
|
||||
|
||||
def put(self, key: int, val: str):
|
||||
"""新增操作"""
|
||||
"""新增和更新操作"""
|
||||
pair = Pair(key, val)
|
||||
index: int = self.hash_func(key)
|
||||
self.buckets[index] = pair
|
||||
|
||||
Reference in New Issue
Block a user