Skip to content

Commit 1f2cbf2

Browse files
committed
documentation hotfix
1 parent e2e45cf commit 1f2cbf2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Two-Sum Problem/2Sum.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Determines if there are any entries a[i] + a[j] == k in the array.
3-
Returns the first pair that sums to k as a tuple.
3+
Returns the indices of the first pair of elements that sum to k as a tuple.
44

55
Uses a dictionary to store differences between the target and each element.
66
If any value in the dictionary equals an element in the array, they sum to k.
@@ -17,6 +17,6 @@ func twoSumProblem(a: [Int], k: Int) -> ((Int, Int))? {
1717
map[k - a[i]] = i
1818
}
1919
}
20-
20+
2121
return nil // if empty array or no entries sum to target k
2222
}

0 commit comments

Comments
 (0)