(TreeNode root)
| 20 | } |
| 21 | |
| 22 | private int helper(TreeNode root) { |
| 23 | if (root == null) return 0; |
| 24 | int l = helper(root.left); |
| 25 | int r = helper(root.right); |
| 26 | if (l + r > max) max = l + r; |
| 27 | return Math.max(l, r) + 1; |
| 28 | } |
| 29 | |
| 30 | public static void main(String[] args) { |
| 31 | Solution solution = new Solution(); |
no outgoing calls
no test coverage detected