Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/neetcode-gh/leetcode
/ hashcode
Method
hashcode
python/0706-design-hashmap.py:11–12 ·
view source on GitHub ↗
(self, key)
Source
from the content-addressed store, hash-verified
9
self.map = [ListNode()
for
i in range(1000)]
10
11
def
hashcode(self, key):
12
return
key % len(self.map)
13
14
def
put(self, key: int, value: int) -> None:
15
cur = self.map[self.hashcode(key)]
Callers
3
put
Method · 0.95
get
Method · 0.95
remove
Method · 0.95
Calls
no outgoing calls
Tested by
no test coverage detected