Skip to main content

Hash Pair Duel

Find the hidden pair that sums to the target, and learn to think in complements, the insight that turns O(n²) pair-checking into one hash-map pass.

two-sumhash mapscomplement lookupO(n²) vs O(n)Read the lesson
How to play
  1. Each round deals a hand of number cards and a target sum.
  2. Click two cards you believe add up to exactly the target.
  3. After your first pick, the game tells you the complement a hash set would look up, use it.
  4. Correct pairs advance the round (hands get bigger); misses cost accuracy and earn the lesson anyway.

Hash Pair Duel

Two-sum is the gateway problem of hash thinking: instead of comparing every pair (O(n²)), store what you have seen and ask each new value for its complement (O(n)). Five rounds, bigger hands each time.

Estimated play time: 3–5 min. Scores feed your local progress, stored only in this browser.