Merge Two Binary Trees
@littleshortfairy yh,you solution maybe more clear,
Thanks for nice explaination!
@alexander In fact ，There are some new nodes created using new operator and some original nodes form two original trees, if there any ways to avoid the mixture of two different nods?Thanks
The python code is clean and beautiful!
No one has replied
@loctn so cool
The question exclusively demanded "You need to merge them into a new binary tree." That is why I created the new node
The runtime for this solution is O(n) as we are just traversing each node element in the tree.
judgement can be simplified
This doesn't create a new binary tree as required in the problem desc.
Disabled Categories are greyed out
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.