Problem context and objectives
Mission briefing
Expedition navigator · Safe camps and hazards form a connected world map
Find a valid route while marking every place already explored: Fewest Hops.
Without visited state, the party loops forever or revisits expensive terrain.
How you win
- 1Recognize when Unweighted shortest path by BFS matches the clues
- 2Keep this true after every move: every queued node has its shortest distance and all earlier queue entries are no farther away
- 3Reach the result within O(V + E) time and O(V) space
Rules and pressure
- Target cost: O(V + E) time and O(V) space
- State rule: every queued node has its shortest distance and all earlier queue entries are no farther away
New words in this mission
Open a term for a plain-language explanation.durable queue+
A waiting line that keeps work until a consumer finishes it. It absorbs bursts and lets failed work be retried.
Lesson 1 of 3
Freeze the frontier as one distance ring and expand the complete ring together.
Your call · Why must node 3 wait until the complete distance-1 frontier [1, 2] is processed?