N-ary Tree Level Order Traversal
CodingPhone ScreenSoftware EngineerReported Dec, 2025
Examples
Example 1:
Input: serialized = [1,-1,3,2,4,-1,5,6]
Output: [[1],[3,2,4],[5,6]]
Example 1:
Input: serialized = [1,-1,3,2,4,-1,5,6]
Output: [[1],[3,2,4],[5,6]]
This practice version receives the N-ary tree in level-order form using -1 separators between sibling groups, for example [1,-1,3,2,4,-1,5,6].
Return the level order traversal of the tree values.
0 <= serialized.length <= 10^4-1 is reserved as the separator marker.Reported as LeetCode 429 in a software engineer phone screen.