| Topic | Difficulty | Companies |
|---|---|---|
| Binary Tree | EASY | Amazon Facebook |
Given the root node of a binary tree, write a program to find its minimum depth.
Problem Note
Example 1
Input: Given a binary tree [10,5,15,null,null,11,6]
10
/ \
5 15
/ \
11 6
Output: 2
Explanation: Shortest path to leaf is 10 -> 5
Example 2
Input: Given a binary tree [1,null,2]
1
\
2
Output: 2
Explanation: Shortest path to leaf is 1 -> 2