104. Maximum Depth of Binary Tree

Practice Maximum Depth of Binary Tree for free on NudgeCode: Easy, Binary Tree pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.

Return the maximum depth of a binary tree: the number of nodes on the longest path from the root down to a leaf.

Trees are written in level order, with null for a missing child.

Example

root = [3,9,20,null,null,15,7]  ->  3

Constraints