Tap here to switch tabs
Problem
Submissions

Problem: Sum of Left Leaves

Try to solve the Sum of Left Leaves problem.

Statement

Given the root of a binary tree, calculate and return the sum of all left leaves.

A leaf is defined as a node that has no children. A left leaf is a leaf node that is the left child of its parent node.

Constraints:

  • The number of nodes in the tree is in the range [1,1000][1, 1000].

  • −1000≤-1000 \leq Node.val ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Sum of Left Leaves

Try to solve the Sum of Left Leaves problem.

Statement

Given the root of a binary tree, calculate and return the sum of all left leaves.

A leaf is defined as a node that has no children. A left leaf is a leaf node that is the left child of its parent node.

Constraints:

  • The number of nodes in the tree is in the range [1,1000][1, 1000].

  • −1000≤-1000 \leq Node.val ≤1000\leq 1000