MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / hash

Method hash

go/0706-design-hashmap.go:28–30  ·  view source on GitHub ↗
(key int)

Source from the content-addressed store, hash-verified

26}
27
28func (this *MyHashMap) hash(key int) int {
29 return key % len(this.Array)
30}
31
32func (this *MyHashMap) Put(key int, value int) {
33 cur := this.Array[this.hash(key)]

Callers 3

PutMethod · 0.95
GetMethod · 0.95
RemoveMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected