← 返回 meta 的题目列表N-ary Tree Expansion
类型:online_judge
Given a list of digits, generate the corresponding N-ary tree structure. Each number is the value of the node, and the tree is formed with an undetermined number of sub-nodes, ensuring each node can have 0 to n child nodes (your discretion). Return the level-order traversal result of the generated tree. Assume the length of the input list is at most 1000.
Example
Input
9
1 2 3 4 5 6 7 8 9