 All Problems
Sum of Left Leaves
easy
trees
dfs
bfs
amazon
google

Given the root of a binary tree (in level-order with "null" for missing nodes), return the sum of all left leaves.

Example 1:

Input: 3 9 20 null null 15 7
Output: 24

Example 2:

Input: 1
Output: 0

Input format: Space-separated level-order values ("null" for absent nodes).

Output format: Sum of left leaves.

Run to check your code against the sample cases, or submit to run every case