@@ -0,0 +1,1161 @@
+package leetcode;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0A%0A/**%0A * https://leetcode.com/problems/n-ary-tree-level-order-traversal/%0A */%0Apublic class Problem429 %7B%0A    private static class Node %7B%0A        public int val;%0A        public List%3CNode%3E children;%0A%0A        public Node() %7B%0A        %7D%0A%0A        public Node(int _val, List%3CNode%3E _children) %7B%0A            val = _val;%0A            children = _children;%0A        %7D%0A    %7D%0A%0A    public List%3CList%3CInteger%3E%3E levelOrder(Node root) %7B%0A        List%3CList%3CInteger%3E%3E result = new ArrayList%3C%3E();%0A        if (root == null) %7B%0A            return result;%0A        %7D%0A        LinkedList%3CNode%3E queue = new LinkedList%3C%3E();%0A        queue.add(root);%0A        while (!queue.isEmpty()) %7B%0A            List%3CInteger%3E list = new ArrayList%3C%3E();%0A            int queueSize = queue.size();%0A            for (int i = 0; i %3C queueSize; i++) %7B%0A                Node node = queue.poll();%0A                for (Node child : node.children) %7B%0A                    queue.add(child);%0A                %7D%0A                list.add(node.val);%0A            %7D%0A            result.add(list);%0A        %7D%0A        return result;%0A    %7D%0A%7D%0A

Solve problem 429