(Node node)
| 70 | } |
| 71 | |
| 72 | public static int height(Node node) { |
| 73 | // write your code here |
| 74 | int height = -1; |
| 75 | for(Node child: node.children) { |
| 76 | int ch = height(child); |
| 77 | height = Math.max(ch, height); |
| 78 | } |
| 79 | height+=1; |
| 80 | |
| 81 | return height; |
| 82 | } |
| 83 | |
| 84 | public static void main(String[] args) throws Exception { |
| 85 | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); |