Skip to content

Commit 7afb00f

Browse files
authored
Update TwoSum.js
1 parent 6713608 commit 7afb00f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

algorithms/TwoSum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var twoSum = function(nums, target) {
99
if (temp[target - nums[i]] !== undefined) {
1010
return [temp[target - nums[i]], i];
1111
}
12-
if (!temp[nums[i]]) {
12+
if (temp[nums[i]] === undefined) {
1313
temp[nums[i]] = i;
1414
}
1515
}

0 commit comments

Comments
 (0)