Skip to content

Commit 384d849

Browse files
author
mykoo
committed
two-sum 조건수정
1 parent 16a767d commit 384d849

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

two-sum/GUMUNYEONG.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var twoSum = function (nums, target) {
1717
let list = [];
1818
const reverseKey = numPair[key];
1919

20-
if (numPair[reverseKey] && parseInt(key) === numPair[reverseKey]) {
20+
if (parseInt(key) === numPair[reverseKey]) {
2121
let firstNum;
2222
let secNum;
2323

@@ -46,3 +46,4 @@ var twoSum = function (nums, target) {
4646

4747
// SC : O(n)
4848
// 크기가 n만큼인 객체(numPair)를 생성하므로 공간 복잡도도 O(n)
49+

0 commit comments

Comments
 (0)