Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Identify before you code

โญโญโญ advancedโณ 10 min read๐Ÿ“ Lesson 201 of 256

Underline the nouns and verbs, then name the shape: remove-scan, accumulator, two-pass โ€” shapes transfer, stories don't.

Nothing on this module's problems tells you the topic. That is the point: on the exam, "ArrayList" never appears in the stem โ€” a story about a waitlist does. The identification step:

  1. Underline the nouns in the spec. "Passengers," "positions," "cap" โ€” each maps to a variable, a list, or a field.
  2. Underline the verbs: "adds," "removes," "counts," "shifts." Verbs over collections โ†’ list mutation; verbs over letters โ†’ string traversal; verbs over "each row" โ†’ nested loops.
  3. Name the shape before writing code: this is a remove-scan, this is an accumulator, this is a two-pass. Shapes transfer; stories don't.

The wrong move is diving into code from the story. The right move is a one-line restatement with data types: "given a list of int arrays, count rows whose max exceeds the sum of the rest" โ€” the code writes itself from there.