From 45aca03b92f3a766735972e6d4d3a886ee9c639d Mon Sep 17 00:00:00 2001 From: gyt95 Date: Fri, 16 Dec 2022 00:13:40 +0800 Subject: [PATCH] Update the test --- .../chapter_computational_complexity/leetcode_two_sum.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codes/typescript/chapter_computational_complexity/leetcode_two_sum.ts b/codes/typescript/chapter_computational_complexity/leetcode_two_sum.ts index 865045c79..0087d1ce8 100644 --- a/codes/typescript/chapter_computational_complexity/leetcode_two_sum.ts +++ b/codes/typescript/chapter_computational_complexity/leetcode_two_sum.ts @@ -33,10 +33,10 @@ function twoSumHashTable(nums: number[], target: number): number[] { }; /* Driver Code */ -let nums = [2, 7, 11, 15] -twoSumBruteForce(nums, 9) +let nums = [2, 7, 11, 15], target = 9; +twoSumBruteForce(nums, target) console.log("使用暴力枚举后得到结果:", nums) -let nums1 = [2, 7, 11, 15] -twoSumHashTable(nums1, 9) +let nums1 = [2, 7, 11, 15], target1 = 9; +twoSumHashTable(nums1, target1) console.log("使用辅助哈希表后得到结果", nums1) \ No newline at end of file