๐ 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:
- Underline the nouns in the spec. "Passengers," "positions," "cap" โ each maps to a variable, a list, or a field.
- Underline the verbs: "adds," "removes," "counts," "shifts." Verbs over collections โ list mutation; verbs over letters โ string traversal; verbs over "each row" โ nested loops.
- 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.