EasyTree Depth-First Search

Path Sum

Explanation & Solution

Description

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