Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
CS foundations
/
Hash maps
Two unequal keys select the same bucket. What must a correct hash map do?
from Hash maps
Node 24
beginner
3 min
Two unequal keys select the same bucket. What must a correct hash map do?
Keep both candidates and use key equality to distinguish them.
Overwrite the older entry because a bucket can hold only one logical key.
Treat the keys as equal because their bucket indices match.
Increase the stored hash until it becomes unique.
Check
Ask AI about this kata
Report an error
next kata
Which statement is required by a valid hash-equality contract?
Quiz
A new version is available
Reload