We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a837521 commit ead3083Copy full SHA for ead3083
solution/0104.Maximum Depth of Binary Tree/Solution.java
@@ -0,0 +1,6 @@
1
+class Solution {
2
+ public int maxDepth(TreeNode root) {
3
+ if (root == null) return 0;
4
+ return Integer.max(maxDepth(root.left), maxDepth(root.right)) + 1;
5
+ }
6
+}
0 commit comments