Skip to content

Commit 25cf959

Browse files

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,10 @@ https://leetcode.cn/problems/increasing-order-search-tree/
620620

621621
https://leetcode.cn/problems/two-sum-ii-input-array-is-sorted/
622622

623+
https://leetcode.cn/problems/two-sum-iv-input-is-a-bst
624+
625+
https://leetcode.cn/problems/opLdQZ
626+
623627
#### 安装教程
624628

625629
1. 安装`deno`

opLdQZ/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from "../two-sum-iv-input-is-a-bst/index.ts";

two-sum-iv-input-is-a-bst/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import inorderTraversal from "../binary-tree-inorder-traversal/index.ts";
2+
import { TreeNode } from "../binary-tree-inorder-traversal/TreeNode.ts";
3+
import twoSum from "../two-sum-ii-input-array-is-sorted/index.ts";
4+
5+
export default function findTarget(root: TreeNode | null, k: number): boolean {
6+
const list = inorderTraversal(root);
7+
return twoSum(list, k)[0] >= 1;
8+
}

0 commit comments

Comments
 (0)