mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-04 03:00:06 +08:00
Format JS and TS code.
This commit is contained in:
@@ -60,5 +60,5 @@ for (const target of [2, 6, 20]) {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
binarySearchInsertion
|
||||
};
|
||||
binarySearchInsertion,
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ function twoSumHashTable(nums, target) {
|
||||
// 单层循环,时间复杂度 O(n)
|
||||
for (let i = 0; i < nums.length; i++) {
|
||||
if (m[target - nums[i]] !== undefined) {
|
||||
return [m[target-nums[i]], i];
|
||||
return [m[target - nums[i]], i];
|
||||
} else {
|
||||
m[nums[i]] = i;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user