Skip to content

Commit 11c4cee

Browse files
refactor 226
1 parent c39f7d2 commit 11c4cee

File tree

1 file changed

+2
-2
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+2
-2
lines changed

src/main/java/com/fishercoder/solutions/_226.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public static class Solution3 {
5555
* A more concise version
5656
*/
5757
public TreeNode invertTree(TreeNode root) {
58-
if (root == null || (root.left == null && root.right == null)) {
59-
return root;
58+
if (root == null) {
59+
return null;
6060
}
6161
TreeNode temp = root.left;
6262
root.left = invertTree(root.right);

0 commit comments

Comments
 (0)