Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "Two unequal keys select the same bucket. What must a correct hash map do?" on CodeWiki (https://codewiki.com/practice/mcq/foundations/hash-maps/collision-correctness/).
Context (verbatim from the page):
"""
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.
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in CS foundations. Where you are unsure, say so.