Dynamic Programming

down_to_zeroIn the process of practicing and refreshing algorithms, I am looking at the Down to Zero II challenge from HackerRank.

After reading the challenge a few times and taking a look at some of the discussions I decided to do it in two steps. My first approach is what I would call brute force. It seems to work in some cases but as expected it does not provide an optimal solution in others. The second approach and what seems to be the right one will be discussed in the next post. That approach uses dynamic programming. Continue reading “Dynamic Programming”