Skip to content

Commit b3e0ddd

Browse files
committed
no changes needed for twosum for swift 4
1 parent 8073155 commit b3e0ddd

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

Two-Sum Problem/README.markdown

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Two-Sum Problem
22

3-
### About to be edited for Swift 4 woohoo!
4-
53
You're given an array `a` with numbers. Write an algorithm that checks if there are any two entries in the array that add up to a given number `k`. In other words, is there any `a[i] + a[j] == k`?
64

75
There are a variety of solutions to this problem (some better than others). The following solutions both run in **O(n)** time.

Two-Sum Problem/Solution 1/2Sum.playground/Contents.swift

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//: Playground - noun: a place where people can play
2+
// Last checked with: Version 9.0 beta 4 (9M189t)
23

34
func twoSumProblem(_ a: [Int], k: Int) -> ((Int, Int))? {
45
var map = [Int: Int]()

Two-Sum Problem/Solution 2/2Sum.playground/Contents.swift

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//: Playground - noun: a place where people can play
2+
// Last checked with: Version 9.0 beta 4 (9M189t)
23

34
func twoSumProblem(_ a: [Int], k: Int) -> ((Int, Int))? {
45
var i = 0

0 commit comments

Comments
 (0)