Skip to content

Commit cde0a6d

Browse files
committed
Improved task 1
1 parent 6d78997 commit cde0a6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/g0001_0100/s0001_two_sum/Solution.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Solution {
1111
for (i in numbers.indices) {
1212
val requiredNum = target - numbers[i]
1313
if (indexMap.containsKey(requiredNum)) {
14-
return intArrayOf(indexMap[requiredNum]!!, i)
14+
return intArrayOf(indexMap.getValue(requiredNum), i)
1515
}
1616
indexMap[numbers[i]] = i
1717
}

0 commit comments

Comments
 (0)