arrow_back Back to Challenges

#104 Maximum Depth of Binary Tree

Easy Acceptance 0%
description

Problem Description

Given the `root` of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.

checklist Constraints

The number of nodes in the tree is in the range [0, 10^4].
-100 <= Node.val <= 100

science Examples

Case #1

In: root = [3,9,20,null,null,15,7]
Out: 3

Case #2

In: root = [1,null,2]
Out: 2

Mastery Tags

Recursion Trees

Hiring Companies

Amazon Google Meta
code

Integrated IDE

code_blocks
Coding
psychology
Aptitude