Help with error

sol: https://ide.codingblocks.com/s/421737

prob: https://leetcode.com/problems/minimum-path-sum/

it is giving some error , I’m using the bottom up approach
here as taught in the lecture

you have done some mistakes

  1. you interchangbly use n and m which is wrong
  2. you didn’t initialize the dp vector
    without initializing you can’t use [] operator on vectors

Modified Code

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.