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

Commitedad6e5

Browse files
refactor 1214
1 parentf154fff commitedad6e5

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

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

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,6 @@
55
importjava.util.ArrayList;
66
importjava.util.List;
77

8-
/**
9-
* 1214. Two Sum BSTs
10-
*
11-
* Given two binary search trees,
12-
* return True if and only if there is a node in the first tree and a node in the second tree whose values sum up to a given integer target.
13-
*
14-
* Example 1:
15-
* 2 1
16-
* / \ / \
17-
* 1 4 0 3
18-
*
19-
* Input: root1 = [2,1,4], root2 = [1,0,3], target = 5
20-
* Output: true
21-
* Explanation: 2 and 3 sum up to 5.
22-
*
23-
* Example 2:
24-
* 0 5
25-
* / \ / \
26-
* -10 10 1 7
27-
* / \
28-
* 0 2
29-
*
30-
* Input: root1 = [0,-10,10], root2 = [5,1,7,0,2], target = 18
31-
* Output: false
32-
*
33-
* Constraints:
34-
* Each tree has at most 5000 nodes.
35-
* -10^9 <= target, node.val <= 10^9
36-
* */
378
publicclass_1214 {
389
publicstaticclassSolution1 {
3910
publicbooleantwoSumBSTs(TreeNoderoot1,TreeNoderoot2,inttarget) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp