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: Alien Alphabet.
Without visited state, the party loops forever or revisits expensive terrain.
How you win
- 1Recognize when Topological order from sorted words matches the clues
- 2Keep this true after every move: each edge captures a required alphabet relation and the output prefix contains only zero-indegree characters
- 3Reach the result within O(total characters + alphabet edges)
Rules and pressure
- Target cost: O(total characters + alphabet edges)
- State rule: each edge captures a required alphabet relation and the output prefix contains only zero-indegree characters
Lesson 1 of 3
Only the first differing rune in adjacent sorted words proves an ordering relation.
Your call · Which relation do wrt and wrf prove?