tldr; You start at 3 and want to end up at 4. There is always a guaranteed path. You can only hop onto 1's. You move like a knight, m units in one direction, and n units in another, every time. What is the least number of hops to get to your destination.
Input:
1 2
1 0 1 0 1
3 0 2 0 4
0 1 2 0 0
0 0 0 1 0
You start at 3 and hop to the 1 at the middle top, then to 4. Each hop is 1 unit in 1 direction and 2 units in another. Thus, the answer for this case is 2. Why is BFS better than DFS in this situation?