There is a circuit board and we need to find the minimum distance from a point i,j to point x,y

so matrix is like below where b are blocks which you cant cross,and you need to find minimum distance path from point a to point x ,you can move in 4 directions ,east ,west,north and south

o o a o

o b o b

0 x 0 b

Company :Google