made by Jaehyeok Choi
dynamic programming
Typical dp problem.
We have 3 choices to take right, down , right below.
Calculate all this value and compare it with the max value which we will save it in a dp array.
If value in dp( this is calculated before) is bigger, keep it. If the value (max value in current location + value(candy) in the location we are heading) is bigger than the dp value we are heading, save former value.
By keep updating the value until N-1 , M-1, the biggest value will be saved in dp[N-1][M-1]!
You can contact me through email, which is [email protected]. Thank you for visiting this github!