error
***************unique path2
Error is coming now also
Ok so
add j>0 here if(obstacleGrid[i][j-1] != 1){
and i>0 here if(obstacleGrid[i-1][j] != 1){
This removes syntatical errors ,now try to debug logically
i am not getting what you are trying to say…
Instead of
if(obstacleGrid[i][j-1] != 1){
if(obstacleGrid[i-1][j] != 1){
use
if(j>0&&obstacleGrid[i][j-1] != 1){
if(i>0&&obstacleGrid[i-1][j] != 1){
I have tried this…still runtime error is coming
But the answer is wrong
Hey @nmaurya760
Yes I know that’s why I said try to debug logically yourself.
And I can see many logical errors so it will be better if u see and understand the solution from here if u can’t debug on ur own :https://leetcode.com/problems/unique-paths-ii/solution/
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.