Problem Link:
https://www.codechef.com/problems/GRHARSH
I see all the solutions have 2D dp solution.
I was thinking dp[i] = max gold at the time i.
Is this correct? If it is, can somebody post the correct 1D dp code in the comment section?
And can someone explain the 2D solution as well? Thank you!