Skip to content

Commit a2fd400

Browse files
fix build
1 parent 678cde1 commit a2fd400

File tree

1 file changed

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

1 file changed

+11
-5
lines changed

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,20 @@
1919
public class _951 {
2020
public static class Solution1 {
2121
public boolean flipEquiv(TreeNode root1, TreeNode root2) {
22-
if (root1 == null && root2 == null) return true;
23-
if (root1 == null || root2 == null) return false;
22+
if (root1 == null && root2 == null) {
23+
return true;
24+
}
25+
if (root1 == null || root2 == null) {
26+
return false;
27+
}
2428

25-
if (root1.val != root2.val) return false;
29+
if (root1.val != root2.val) {
30+
return false;
31+
}
2632

2733
return (
28-
(flipEquiv(root1.left, root2.left) && flipEquiv(root1.right, root2.right)) ||
29-
(flipEquiv(root1.left, root2.right) && flipEquiv(root1.right, root2.left))
34+
(flipEquiv(root1.left, root2.left) && flipEquiv(root1.right, root2.right))
35+
|| (flipEquiv(root1.left, root2.right) && flipEquiv(root1.right, root2.left))
3036
);
3137
}
3238
}

0 commit comments

Comments
 (0)