We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2664f27 commit 363a2bfCopy full SHA for 363a2bf
src/main/java/com/fishercoder/solutions/_156.java
@@ -25,8 +25,9 @@
25
public class _156 {
26
27
public TreeNode upsideDownBinaryTree(TreeNode root) {
28
- if (root == null || root.left == null && root.right == null)
+ if (root == null || root.left == null && root.right == null) {
29
return root;
30
+ }
31
TreeNode newRoot = upsideDownBinaryTree(root.left);
32
root.left.left = root.right;
33
root.left.right = root;
0 commit comments