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 Folded Causeway.
Overwrite one next pointer too early and the rest of the expedition becomes unreachable.
How you win
- 1Recognize when Split, reverse, and weave matches the clues
- 2Keep this true after every move: the woven prefix alternates the next unused front and back values
- 3Reach the result within O(n)
Rules and pressure
- Target cost: O(n)
- State rule: the woven prefix alternates the next unused front and back values
Lesson 1 of 3
Break the chain into three proofs: split at the midpoint, reverse the back half, then alternate with saved next references.
Your call · After reversing the second half of [1,2,3,4,5], which node is its head?