Dynamic programmingIntro
The Programming Masterclass · Act 1
Power cut. Hostel staircase. Ten rupees on the line.
The lift is dead, so everyone climbs, taking the steps one or two at a time, everyone mixing their own rhythm. Halfway up, your roommate grins: “Ten rupees says you cannot tell me how many different ways there are to climb ten steps.”
You start on your fingers. 1-1-1-1... one way. 2-1-1... another. 1-2-1... By step five you have lost count twice. Then someone leaning on the railing asks, “okay, and for SIX steps?” and you groan, because you are about to start over from zero.
Quick, honest: how does this feel right now?