Skip to content

Commit 0d7e8da

Browse files
committed
Add comment to two-sum
1 parent ffaa6d8 commit 0d7e8da

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

two-sum/delight010.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ class Solution {
22
func twoSum(_ nums: [Int], _ target: Int) -> [Int] {
33
var dictionary: [Int: Int] = [:]
44
for (index, value) in nums.enumerated() {
5+
// nums배열의 개수만큼 반복합니다. O(n)
56
let difference = target - value
67
if let otherIndex = dictionary[difference] {
78
return [otherIndex, index]

0 commit comments

Comments
 (0)