Skip to content

Commit 3803716

Browse files
jdalmaDaleSeo
andauthored
Update subtree-of-another-tree/jdalma.kt
Co-authored-by: Dale Seo <[email protected]>
1 parent bf87de4 commit 3803716

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subtree-of-another-tree/jdalma.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class `subtree-of-another-tree` {
1414

1515
private fun isSame(root: TreeNode?, subRoot: TreeNode?): Boolean {
1616
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
17+
if (root == null || subRoot == null) return false
18+
if (root.`val` != subRoot.`val`) return false
1919

2020
return isSame(root.left, subRoot.left) && isSame(root.right, subRoot.right)
2121
}

0 commit comments

Comments
 (0)