Path Sum

IF
AlgoAxiomStaff Engineers
JSTS
Easy20 mins

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.

Source: Tree Depth-First Search pattern — AlgoAxiom
JavaScript
Test Case 1
root = [1, 2, 3]
Test Case 2
root = [1, 2, 3, 4, 5]
Idle