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 Ordered Ancestor.
Ignoring the parent-child rule turns a focused search into a full maze traversal.
How you win
- 1Recognize when Lowest common ancestor in BST matches the clues
- 2Keep this true after every move: the current subtree still contains both target values
- 3Reach the result within O(height) time and O(1) space
Rules and pressure
- Target cost: O(height) time and O(1) space
- State rule: the current subtree still contains both target values
Lesson 1 of 3
Keep target band [2, 8] together in the BST; move when the band lies on one side, otherwise stop.
Stop immediately when the target band straddles the root.
Your call · What should happen with target band [2,8] at current node 6?