We are given a matrixof n*m , marked with 0 and 1 , 0 means path is blocked, 1 means we can move .
From top left corner we have to go to our destination(i,j) in matrix in shortest time.
But there are some bombs also in matrix with a timer corresponding to their value in given cell (example arr[2][8]=5 , that means after 5 second or steps their value decrease and become 0 and we cant travel after that upon them , each bomb have different time)
How to find shortest time ?