Back to problems

Shortest Path Nodes and Escaping a Pursuer

Algorithm · Google · Medium

You are given an undirected, unweighted graph. Alice starts at one node and wants to get to a designated target node. Return the length of the shortest path from Alice's starting node to the target. No examples or numeric constraints were provided for this problem. Follow-ups Follow-up 1: Find every node that lies on at least one shortest path from Alice to the target. Follow-up 2: Bob is standing at a different node. Alice selects one shortest path and begins walking along…

Loading the rest of the question…