Sum of Left Leaves
Easy
Trees
Tree
DFS
Find sum of all left leaves in a binary tree given as level-order.
Constraints
Nodes ≤ 1000
Examples
Example 1:
Input: 3 9 20 null null 15 7
Output: 24
Explanation: Left leaves: 9 and 15
Example 2:
Input: 1
Output: 0
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console