← 返回 linkedin 的题目列表Merge N-ary Tree
类型:online_judge
Given two N-ary trees, merge them into one. Each node in the N-ary tree is like TreeNode<V> which contains a value (val) and a list of children (children). Node values are added according to the merge operation definition. Return the merged N-ary tree. Assume the provided N-ary trees have consistent heights.
Example
Input
TreeNode1 and TreeNode2 are provided with consistent heights and structure.