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 bf87de4 commit 3803716Copy full SHA for 3803716
subtree-of-another-tree/jdalma.kt
@@ -14,8 +14,8 @@ class `subtree-of-another-tree` {
14
15
private fun isSame(root: TreeNode?, subRoot: TreeNode?): Boolean {
16
if (root == null && subRoot == null) return true
17
- else if (root == null || subRoot == null) return false
18
- else if (root.`val` != subRoot.`val`) return false
+ if (root == null || subRoot == null) return false
+ if (root.`val` != subRoot.`val`) return false
19
20
return isSame(root.left, subRoot.left) && isSame(root.right, subRoot.right)
21
}
0 commit comments