Gold grid problem

wrong answer…

https://del.dog/zobicidefi

my code …

Hi @tushant8826
in ur code change
for(int i=2;i<=n;i++) dp[i][0]=dp[i-1][0]+a[i][0];
for(int i=2;i<=n;i++) dp[0][i]=dp[0][i-1]+a[0][i];
to
for(int i=2;i<=n;i++) dp[i][1]=dp[i-1][1]+a[i][1];
for(int i=2;i<=n;i++) dp[1][i]=dp[1][i-1]+a[1][i];
since u r using 1 based indexing, use d 1 instead of 0 above.
Hope dis helps.
If u still have any doubts or feel like something is unclear, feel free to post ur doubts here.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.