We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9023573 commit c4edf2dCopy full SHA for c4edf2d
EASY/src/easy/SameTree.java
@@ -15,7 +15,6 @@ public class SameTree {
15
//recursion idea flows out naturally.
16
public boolean isSameTree(TreeNode p, TreeNode q) {
17
if(p == null || q == null) return p == q;
18
- if(p.val != q.val) return false;
19
- return isSameTree(p.left, q.left) && isSameTree(p.right, q.right);
+ return p.val == q.val && isSameTree(p.left, q.left) && isSameTree(p.right, q.right);
20
}
21
0 commit comments