Problem context and objectives
Mission briefing
Portal network mechanic · Travel portals are connected as a one-way chain
Repair the links without losing the unexplored route: The Reversal Portal.
Overwrite one next pointer too early and the rest of the expedition becomes unreachable.
How you win
- 1Recognize when In-place sublist reversal matches the clues
- 2Keep this true after every move: nodes before left and after right retain their original relative order
- 3Reach the result within O(n)
Rules and pressure
- Target cost: O(n)
- State rule: nodes before left and after right retain their original relative order
Lesson 1 of 3
Predecessor and current are fixed anchors. Each lift moves current.next to the segment front while the suffix remains attached to current.
Your call · Where does current stay after the first lift?