Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit95c308d

Browse files
refactor 1305
1 parent33a2bb7 commit95c308d

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

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

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,6 @@
66
importjava.util.Collections;
77
importjava.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
publicclass_1305 {
3910
publicstaticclassSolution1 {
4011
publicList<Integer>getAllElements(TreeNoderoot1,TreeNoderoot2) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp