r*******y 发帖数: 1081 | 1 . . . . e
. . x . .
. s . x .
. . . . .
Need to find a shortest path from starting s to ending e
and can not pass through the point marked with x
At each point we can go right, left, up or down.
Thanks. | D*******e 发帖数: 151 | 2 Do BFS starting from e. Maintain the depth during search. Return depth the
first time arriving at s. |
|