The sign of a trap
transcript
A grid has traps and potions. You need the least starting health. One sign decides the answer. Let us find which one.
A trap of minus three must raise the need. Adding the change lowers it, and returns one. Subtracting gives one minus minus three, which is four.
Take the smaller need of the next rooms. Subtract this room's change. The result is never less than one.
Fill from the last room. It needs six. Each room reads the rooms after it, never the ones before. Working back, the need rises to five. The first room needs seven.
A grid of two hundred by two hundred has forty thousand cells. Each cell reads two others, so the table is fast.
Test a grid of one room. Test a trap on its own, as in the lesson. Test a potion on its own. The need is one.
A trap raises the need. So subtract the change. Full breakdown in the lecture.