pull/116/head
gyt95 2 years ago
parent 76693ab0fb
commit f7952fca25

@ -2,7 +2,7 @@
* @Author: gyt95 (gytkwan@gmail.com)
* @Date: 2022-12-15 10:51:54
* @Last Modified by: gyt95 (gytkwan@gmail.com)
* @Last Modified time: 2022-12-15 23:40:09
* @Last Modified time: 2022-12-16 00:00:35
*/
/**
@ -33,4 +33,13 @@ function twoSumHashTable(nums, target) {
m[target - nums[i]] = i;
}
}
}
}
/* Driver Code */
let nums = [2, 7, 11, 15]
twoSumBruteForce(nums)
console.log("使用暴力枚举后得到结果:", nums)
let nums1 = [2, 7, 11, 15]
twoSumHashTable(nums1)
console.log("使用辅助哈希表后得到结果", nums1)

Loading…
Cancel
Save