Maximum Depth of Binary Tree
Given the root of a binary tree, return its maximum depth.

30:00

Maximum Depth of Binary Tree
easy
Topics
Companies

Given the root of a binary tree, return its maximum depth.

Example 1:
Input: {"root":[3,9,20,null,null,15,7]}
Output: 3
Constraints:
  • The number of nodes is in the range [0,104][0, 10^4].

  • 100Node.val100-100 \leq \text{Node.val} \leq 100

Input
arr ={"root":[3,9,20,null,null,15,7]}
Depth
1
Max Depth
0

3

9

20

15

7

Variables
No variables to display
DepthFunction Call
Stack empty
0/26