Skip to content
playdsa
Preferences

Make yourself comfortable.

Saved on this browser. Your device’s reduced-motion preference is always respected.

Theme
Advanced settings

The Target Root Path

Learn
Play
Prove
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 Target Root Path.

Ignoring the parent-child rule turns a focused search into a full maze traversal.

How you win

  1. 1Recognize when Root-to-leaf path sum matches the clues
  2. 2Keep this true after every move: remaining equals target minus every value on the active root-to-current path
  3. 3Reach the result within O(n) time and O(height) space

Rules and pressure

  • Target cost: O(n) time and O(height) space
  • State rule: remaining equals target minus every value on the active root-to-current path
Lesson 1 of 3

Build a connected root-to-leaf route and track its branch-local remainder. Zero remaining succeeds only at a leaf.

Build a connected root-to-leaf path that spends the target charge exactly.

Your call · Which path reaches target 22?

Help shape PlayDSA

Something confusing, broken, or missing? Leave a quick note without leaving your lesson.

Please leave out passwords, payment details and other private information.

Page included: /

Sign in to save feedback here, or send it with your email app. Your draft stays here while you sign in.

Open email instead