The original question is: given an unbounded 2D map, we want to know if a robot can reach the destination `(xd, yd)`

from starting position `(xs, ys)`

. An API is given: `bool isPath(int x, int y)`

, which tells you whether you can reach location `(x, y)`

. The robot can move in 8 directions. This question is easy to get using a two way BFS search.

The follow up is where I haven't got a good idea. I was asked to simultaneously find K paths that are distinct from each other (paths do not intersect or share any segments). Of course K is less than 8.

Any thoughts?