Update ts code and docs

This commit is contained in:
gyt95
2022-12-16 16:33:12 +08:00
parent 45aca03b92
commit 84caa60cd4
2 changed files with 10 additions and 8 deletions

View File

@@ -97,7 +97,7 @@ comments: true
```typescript title="leetcode_two_sum.ts"
function twoSumBruteForce(nums: number[], target: number): number[] {
let n = nums.length;
const n = nums.length;
// 两层循环,时间复杂度 O(n^2)
for (let i = 0; i < n; i++) {
for (let j = i + 1; j < n; j++) {