package leetcode;

import java.util.List;

/**
 * https://leetcode.com/problems/n-ary-tree-postorder-traversal/
 */
public class Problem590 {
    private static class Node {
        public int val;
        public List<Node> children;

        public Node() {
        }

        public Node(int _val, List<Node> _children) {
            val = _val;
            children = _children;
        }
    }

    public List<Integer> postorder(Node root) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem590 prob = new Problem590();
    }
}

@@ -12,16 +12,44 @@
 tcode;%0A%0A
+import java.util.ArrayList;%0A
 import j
@@ -480,15 +480,82 @@
     
-// TODO
+List%3CInteger%3E result = new ArrayList%3C%3E();%0A        postOrder(root, result);
 %0A   
@@ -570,12 +570,14 @@
 urn 
-null
+result
 ;%0A  
@@ -586,21 +586,22 @@
 %7D%0A%0A    p
-ublic
+rivate
  static 
@@ -609,71 +609,227 @@
 oid 
-main(String%5B%5D args) %7B%0A        Problem590 prob = new Problem590(
+postOrder(Node root, List%3CInteger%3E result) %7B%0A        if (root == null) %7B%0A            return;%0A        %7D%0A        for (Node node : root.children) %7B%0A            postOrder(node, result);%0A        %7D%0A        result.add(root.val
 );%0A 

Solve problem 590