Naive dynamic programming solution instance initialization functionality complete.