Dynamic Programming 2-D Array

Say I have a 2-D Array with the values inputted below

3 4 2

6 9 8

13 12 15

How could I use dynamic programming in C++ to find the largest sum and its respective path?

*we can only move diagonally from top to bottom.

In this case, the largest sum would be 27 and its path would be 0,1,2

Public Answer

CMXW7F The First Answerer