Contains Duplicate
nums is a list of integers Return true when some number shows up more than once Return false when each number shows up only once Example: [4, 9, 4] => true (4 shows up twice) Example: [5, 6, 7] => false (no repeats)
Contains Duplicate is a classic scan-and-record problem: the right bookkeeping beats brute force. It's a great warm-up that builds data-structure instincts without a ton of moving parts. Watch your edge cases around repeats, and be clear about what your map is storing.

Meet Coco
Coco is an AI study partner, not a person. She listens while you explain your code, asks what a line does and never hands you the fix. Sign in free to type with Coco, up to a daily limit, and to talk with her for one hour. After that, talking comes with the $79 pack. Anyone can open the editor and run their code.
Each locked part opens in the editor once the part before it passes.