Leetcode doubt on prolems


question link-https://leetcode.com/problems/minimum-path-sum/

Can understand why its giving compile error.Please correct the code and send it to me.

Please give the correct link for solution

solution link=https://ide.codingblocks.com/s/575115

@Somasree initially you are not given i and j, and you have not given them any default values either so how will the compiler know what are i and j. You can use a helper function to do top-down dp so you can set all the parameters as you like. I am giving you code for bottom up DP: https://ide.codingblocks.com/s/575142

here in your solution you have returned dp[m-1][n-1],instead of d[m][n].Was it because the loop is from 1 to m-1 and 1 to n-1???

the size of dp array is m, n so the index will be from 0-m-1 and 0-n-1 but they still have m*n elements i hope thats clear!

Please mark your doubt as resolved if its resolved

CAn u plz give me feedback link .I can give you rating there

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.