You are viewing a single comment's thread. Return to all comments →
this problem is so weird to me
i tried to solve it using DP
here is my solution idea : func(x,y) : check limits of the grid , if(y = last col) return grid[x][y] , minmize between func(x+1,y), func(x-1,y), func(x,y+1) + grid[x][y] .
but this solution crash and goes into infinite recursive calls , hints pleaee