Skip to content

Commit 95c308d

Browse files
refactor 1305
1 parent 33a2bb7 commit 95c308d

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

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

-29
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,6 @@
66
import java.util.Collections;
77
import java.util.List;
88

9-
/**
10-
* 1305. All Elements in Two Binary Search Trees
11-
*
12-
* Given two binary search trees root1 and root2.
13-
* Return a list containing all the integers from both trees sorted in ascending order.
14-
*
15-
* Example 1:
16-
* Input: root1 = [2,1,4], root2 = [1,0,3]
17-
* Output: [0,1,1,2,3,4]
18-
*
19-
* Example 2:
20-
* Input: root1 = [0,-10,10], root2 = [5,1,7,0,2]
21-
* Output: [-10,0,0,1,2,5,7,10]
22-
*
23-
* Example 3:
24-
* Input: root1 = [], root2 = [5,1,7,0,2]
25-
* Output: [0,1,2,5,7]
26-
*
27-
* Example 4:
28-
* Input: root1 = [0,-10,10], root2 = []
29-
* Output: [-10,0,10]
30-
*
31-
* Example 5:
32-
* Input: root1 = [1,null,8], root2 = [8,1]
33-
* Output: [1,1,8,8]
34-
*
35-
* Constraints:
36-
* Each tree has at most 5000 nodes.
37-
* Each node's value is between [-10^5, 10^5].*/
389
public class _1305 {
3910
public static class Solution1 {
4011
public List<Integer> getAllElements(TreeNode root1, TreeNode root2) {

0 commit comments

Comments
 (0)