-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #487 from sumiranverma/patch-9
Create question.md
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Given the `root` of a binary tree, return the sum of all left leaves. | ||
|
||
A **leaf** is a node with no children. | ||
A **left leaf** is a leaf that is the left child of another node. | ||
|
||
### **_Example 1_** | ||
|
||
![image](https://github.com/SnowScriptWinterOfCode/LeetCode_Q/assets/112773734/82f26aff-30a7-4d6e-91ad-dd0cdc562ff6) | ||
|
||
**Input**: root = [3,9,20,null,null,15,7] | ||
**Output**: 24 | ||
**Explanation**: There are two left leaves in the binary tree, with values 9 and 15 respectively. | ||
|
||
### **_Example 2_** | ||
|
||
**Input**: root = [1] | ||
**Output**: 0 | ||
|
||
|
||
### Constraints: | ||
|
||
- The number of nodes in the tree is in the range `[1, 1000]`. | ||
- `1000` <= Node.val <= `1000` | ||
|
||
### problem link: | ||
https://leetcode.com/problems/sum-of-left-leaves/ |