We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2a17ce commit fd0d221Copy full SHA for fd0d221
two-sum/dohee789.java
@@ -8,7 +8,7 @@ public int[] twoSum(int[] nums, int target) {
8
for(int i = 0; i < nums.length; i++) {
9
if(map.containsKey(target - nums[i])) {
10
int j = map.get(target - nums[i]);
11
- return new int[]{i, j};
+ return new int[]{j, i};
12
}
13
map.put(nums[i], i);
14
0 commit comments