You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varmergeTrees=function(t1,t2){//if both trees have no children, return sum of root nodesif(t1&&!t2){returnt1;}if(!t1&&t2){returnt2;}if(!t1&&!t2){returnnull;}t1.val+=t2.val;t1.left=mergeTrees(t1.left,t2.left);t1.right=mergeTrees(t1.right,t2.right);returnt1;};
https://leetcode.com/problems/merge-two-binary-trees/submissions/
The text was updated successfully, but these errors were encountered: