Root-to-Leaf Path Sum and All Matching Paths

Problem

Given a binary tree where each node contains an integer value, and an integer targetSum.

  1. Determine whether there exists a root-to-leaf path such that the sum of all node values o...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: