Skip to main content
PProfileMatch
← Path

Dynamic Programming · Dynamic Programming Space Optimization and Interview Strategy

0 XP
  1. 1 current stop: learning
  2. 2 upcoming
  3. 3 upcoming
  4. 4 upcoming
  5. 5 upcoming

Finish after stop 5

Stop 1 of 5 · Unpacking panniers at the campsite

Trick to keep in mind+3 XP

Rolling rows: same speed, far less memory, but no road back.

When each row reads only the previous one, older rows can be discarded and the final number is unchanged. The cost is that those discarded rows were the evidence for how you got there. Tracing which edits or choices were used needs the stored table, so only roll when the value alone is enough.

Read it once, then a question tests whether the trick stuck.