LeetCode 112. Path Sum
題目:
給一個binary tree 和一個sum的值,去看從root到leaf有沒有一個path的和式等於這個sum值。例如底下範例5,4,11,2的和剛好是sum=22
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.