Skip to content

Commit fd0d221

Browse files
dohee789dohee789
authored andcommitted
🥅 modify two-sum solution
1 parent e2a17ce commit fd0d221

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

two-sum/dohee789.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public int[] twoSum(int[] nums, int target) {
88
for(int i = 0; i < nums.length; i++) {
99
if(map.containsKey(target - nums[i])) {
1010
int j = map.get(target - nums[i]);
11-
return new int[]{i, j};
11+
return new int[]{j, i};
1212
}
1313
map.put(nums[i], i);
1414
}

0 commit comments

Comments
 (0)