Grid path question of CSES


this code is not passing all test cases of question grid path
ques link =>>https://cses.fi/problemset/task/1638/

Hey @ankit_verma in your if condition of line number 22, make dp[i][j]=1 and then try to submit. It might get accepted.

no this is wrong approach it will not work bcz if there is any star then we wouldn’t able to go there so there is qlways is 0

See this question resembles


And my submission

So approach is fine just try to implement it.

no this is not working i tried this

Might be some false test cases. Try submitting it on leetcode, it will get accepted for sure .

but how thousand of peoples already solve this problem?

Bro as far as I know , i have shown you the same problem on leetcode with my accepted code. Moreover I would suggest you to make a function like I did and instead of working with vector , work with an array so that you can be sure for every ith and jth element of your dp array.
Moreover if you still feel that your doubt is not been resolved properly you can tell me, some other TA will be assigned to you.

yes i have still doubt

So lemme close this doubt and after that you can reopen it.

hello @ankit_verma
check now,
u missed to handle some conditions,
check now->

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.