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, or false otherwise.
A leaf is a node with no children. A path must start at the root and end at a leaf — it cannot stop partway down.
Input / output
root: TreeNode, targetSum: int (JSON test fixture for root is a LeetCode-style level-order array, e.g. [5,4,8,11,null,13,4,7,2,null,null,null,1], with null for a missing child)booleanCan you solve it iteratively with an explicit stack instead of recursion, tracking the running sum alongside each node?