Created
August 14, 2017 21:59
-
-
Save cemolcay/8d408e0ded9263e31aa10b4cc358311b to your computer and use it in GitHub Desktop.
hackerrank swift input reader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
var input = [[Int]]() | |
while let line = readLine() { | |
input.append(line.components(separatedBy: [" "]).map { Int($0)! }) | |
} | |
print(input) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment