Nathan Wilson

This is a great question. It’s definitely not *necessary* to do the last step, since it shouldn’t change the performance, but in many problems it can make the code a lot simpler. In the case of the Fibonacci problem, it also gives you the opportunity to optimize the solution even further (although I didn’t include that in this post). I’d definitely recommend grabbing the ebook (www.byte-by-byte.com/dpbook) so that you can see other examples of problems and hopefully it’ll make more sense.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.