Skip to content

Commit 8c44c2a

Browse files
refactor 617
1 parent 1061560 commit 8c44c2a

File tree

1 file changed

+0
-27
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-27
lines changed

src/main/java/com/fishercoder/solutions/_617.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,6 @@
22

33
import com.fishercoder.common.classes.TreeNode;
44

5-
/**
6-
* 617. Merge Two Binary Trees
7-
*
8-
* Given two binary trees and imagine that when you put one of them to cover the other,
9-
* some nodes of the two trees are overlapped while the others are not.
10-
You need to merge them into a new binary tree.
11-
The merge rule is that if two nodes overlap,
12-
then sum node values up as the new value of the merged node.
13-
Otherwise, the NOT null node will be used as the node of new tree.
14-
15-
Example 1:
16-
Input:
17-
Tree 1 Tree 2
18-
1 2
19-
/ \ / \
20-
3 2 1 3
21-
/ \ \
22-
5 4 7
23-
Output:
24-
Merged tree:
25-
3
26-
/ \
27-
4 5
28-
/ \ \
29-
5 4 7
30-
Note: The merging process must start from the root nodes of both trees.
31-
*/
325
public class _617 {
336

347
public static class Solution1 {

0 commit comments

Comments
 (0)