1 min lesson
A 45-minute mental template
Rebuild the sequence in "A 45-minute mental template" from memory, ending with the check that proves the outcome.
Step 1 of 2
A 45-minute mental template
- 1Contract (2 min). Write the typed signature and a one-line constraint, restate aloud.
- 2Brute force (5 min). Get a correct, obvious version working; name its complexity.
- 3Optimize (15 min). Apply the size-before-hash / right-to-left / BFS insight; keep it readable.
- 4Edge cases (8 min). Empty, single, overlapping, out-of-range - assert each.
- 5Walk it (rest). Trace one input end to end out loud, then state what you'd test next with more time.
Watch out
Don't gold-plate the type system. Elaborate conditional types or branded generics burn time and rarely earn points in a 45-minute screen. Clean, obvious types that compile cleanly win; clever types that you spend ten minutes debugging lose.