Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-ui authored Dec 17, 2022
1 parent 718d7a5 commit 6a346a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions 0617-merge-two-binary-trees/0617-merge-two-binary-trees.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
*/
const mergeTrees = (t1, t2) => {
if (!t1) {
return t2
return t2;
}
if (!t2) {
return t1
return t1;
}
t1.val += t2.val
t1.left = mergeTrees(t1.left, t2.left)
t1.right = mergeTrees(t1.right, t2.right)
return t1
}
return t1;
}

0 comments on commit 6a346a6

Please sign in to comment.