Solve the sum leaf node values problem in leetcode. Pre order traversal for the tree and sum the path from root to leaf.