Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 454 Bytes

559.md

File metadata and controls

9 lines (5 loc) · 454 Bytes

559. Maximum Depth of N-ary Tree

Given a n-ary tree, find its maximum depth.

The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.

Nary-Tree input serialization is represented in their level order traversal, each group of children is separated by the null value (See examples).

Just dfs and records the deepest dfs path we have been to. accept. Python code can be really clean and easy.