Shortest path, nodes on any shortest path, and can Alice evade Bob

0
Remix

You get an undirected, unweighted graph with n nodes. Alice starts at node a and wants to reach node t.

  1. Return the length of the shortest path from a to t.
  2. Return every node that lies on at least one shortest path from a to t.
  3. Bob is also on the graph and tries to catch Alice. Decide whether Alice can reach t without Bob getting to her first.
GoogleCodingLast asked Sep 2026
No answer yet. Write the first one; the best answer gets endorsed.