Each outcome is backed by the checks that test it. Solid means every check was right first time; with hints means you got there with a nudge; worth a revisit means an answer was revealed or is still wrong.
1
Restate a problem you have not seen in your own words, ask the questions that settle what it means, and work its smallest example by hand.
Not yet
2
Write the slow, obvious answer first, count how many pairs it checks, and say its cost as O(n²) in plain words.
Not yet
3
Find the question a slow answer keeps repeating, name the tool that answers it fast, and write the faster code with its cost in time and in extra memory.
Not yet
4
Test an answer on its edge cases (empty, one item, repeated and negative numbers, no answer) and against the slow answer before saying it is done.
Not yet
Your cheat sheet
What each lesson leaves you able to do, in one place. Lessons you have not finished are dimmed, not hidden.
Name the six steps: restate and ask, work a tiny example by hand, write the brute force and count it, find the cue, write and walk through the code, test the edges.
Restate two sum in your own words: two different positions whose numbers add up to the target, or an empty list when no pair does.
Ask the questions that settle the problem: the same item twice, no answer, positions or values, negative or repeated numbers.
Work [3, 2, 4] with target 6 by hand to get [1, 2], and say why [0, 0] is wrong.
List the edge cases worth trying every time: repeated numbers, negative numbers, zero, no answer, one item, an empty list.
Run the fast answer next to the brute force on every edge case and compare.
Say which test catches the store-first mistake: a pair of equal numbers, such as [3, 3] with target 6.
Remember that when two pairs add up, the two answers can return different pairs that are both right, so check that the pair adds up rather than comparing pairs.
Take contains-a-duplicate through the six steps: restate it, count the brute force, find the cue that points to a hash set, write the check line, and test the empty, one-item and repeated cases.