Coding Challenge

Maximum Depth of Binary Tree

Easy
treedfs

Return the height of a binary tree.

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

Examples

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

Output: 3

Constraints

  • Tree may be empty

Preparing your coding workspace...