Format JS and TS code.

This commit is contained in:
krahets
2023-09-02 23:07:47 +08:00
parent f96f583771
commit 978857570f
35 changed files with 75 additions and 74 deletions

View File

@@ -60,5 +60,5 @@ for (const target of [2, 6, 20]) {
}
module.exports = {
binarySearchInsertion
};
binarySearchInsertion,
};

View File

@@ -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;
}