Problem context and objectives
Mission briefing
Archive pathfinder · Clues branch through a living archive
Explore only the branches that can still contain the answer: The Zigzag Canopy.
Ignoring the parent-child rule turns a focused search into a full maze traversal.
How you win
- 1Recognize when Zigzag level order matches the clues
- 2Keep this true after every move: each completed output row contains exactly one tree depth in the requested direction
- 3Reach the result within O(n) time and O(width) space
Rules and pressure
- Target cost: O(n) time and O(width) space
- State rule: each completed output row contains exactly one tree depth in the requested direction
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
Predict each output row. Compare the queue order with the destination slots. Lesson questions refer to the original tree.
Separate queue order from output position. Predict the slot, then run the trace.
Your call · On a reverse level, the queue removes 9 then 20. With size=2, where should 9 be written?