Solving dynamic programming problems

...with static array. Maybe should have used maps just for the practice?