Coding

Maximum Depth of an N-ary Tree

Find the maximum depth of an N-ary tree.

Input: root = [1,null,2,null,3,null,4]

Output: 4

Explanation: The tree is essentially a straight line, requiring a traversal that reaches a maximum depth of 4 layers.

Was asked at

Practice this question with AI

First session is free - no credit card required.

Go Premium

More interviews, more skills, more success.

No answers yet

Be the first to share your approach to this question

Practice More Questions