You are given a m * n grid consisting of 0s and 1s, 0 meaning you can pass through that cell and 1 meaning the cell is blocked. Initially, you are at (0,0). You want to reach (m-1,n-1) in the least number of steps. In 1 step, from a cell (i,j) you can go to (i+x,j), (i-x,j), (i,j-x), (i,j+x) where 1<=x<=k. K is given as input denoting maximum jump distance you can take from a cell.
Additionally, you can only move from 1 cell to other if all the cells between those 2 cells don't contain any blocked cells.
I wasn't able to solve it but any help would be appreciated.
Constraints:
1<=m,n,k<=200
Comments (11)


