← PayPal questions

Root-to-leaf path sum

Filed under PayPal · Also reported at Teradata

Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related PayPal questions

Collected from public candidate posts and coding forums. Updated Nov 2026.