package com.fishercoder.common.classes;

import java.util.ArrayList;
import java.util.List;

public class Node {
  public int val;
  public List<Node> children;

  public Node() {
  }

  public Node(int val, List<Node> children) {
    this.val = val;
    this.children = children;
  }

  public Node(int val) {
    this.val = val;
    this.children = new ArrayList<>();
  }

  //todo: implement this method
  /**return a N-ary tree based on the preorder values*/
  public static Node createNaryTree(List<Integer> preorderValues) {
    return null;
  }
}

@@ -106,16 +106,18 @@
  Node %7B%0A
+  
   public
@@ -126,16 +126,18 @@
 nt val;%0A
+  
   public
@@ -159,16 +159,18 @@
 ldren;%0A%0A
+  
   public
@@ -179,21 +179,25 @@
 ode() %7B%0A
+  
   %7D%0A%0A
+  
   public
@@ -230,24 +230,28 @@
 children) %7B%0A
+    
     this.val
@@ -254,32 +254,36 @@
 .val = val;%0A    
+ 
+   
 this.children = 
@@ -294,19 +294,23 @@
 dren;%0A  
+ 
+ 
 %7D%0A%0A
+  
   public
@@ -326,24 +326,28 @@
  val) %7B%0A    
+ 
+   
 this.val = v
@@ -346,24 +346,28 @@
 .val = val;%0A
+    
     this.chi
@@ -393,21 +393,25 @@
 st%3C%3E();%0A
+  
   %7D%0A%0A
+  
   //todo
@@ -438,13 +438,24 @@
 hod%0A
+%0A  
   /**
+%0A     * 
 retu
@@ -502,11 +502,19 @@
 lues
+%0A     
 */%0A
+  
   pu
@@ -573,24 +573,28 @@
 erValues) %7B%0A
+    
     return n
@@ -598,14 +598,16 @@
 n null;%0A
+  
   %7D%0A%7D%0A

refactor Node