Skip to content

Commit 35d3081

Browse files
committed
fix: as comment
1 parent 0e4450d commit 35d3081

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed
File renamed without changes.

β€Žtwo-sum/dev_qorh.tsβ€Ž renamed to β€Žtwo-sum/Baekwangho.tsβ€Ž

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,9 @@
22
* κ°€μž₯ λ‹¨μˆœν•œ O(n^2) 둜 ν’€μ΄ν•˜μ˜€μŠ΅λ‹ˆλ‹€
33
*/
44
function twoSum(nums: number[], target: number): number[] {
5-
let temp_i = 0;
6-
let temp_j = 0;
7-
85
for (let i = 0; i < nums.length; i++) {
9-
temp_i = nums[i];
106
for (let j = i + 1; j < nums.length; j++) {
11-
temp_j = nums[j];
12-
13-
if (temp_i + temp_j === target) {
7+
if (nums[i] + nums[j] === target) {
148
return [i, j];
159
}
1610
}

0 commit comments

Comments
Β (0)