Created
April 2, 2017 23:33
-
-
Save fhorlaville/f4388e452ab1f07caef362119da2a14e to your computer and use it in GitHub Desktop.
HackerRank Swift loader functions, to read the input
This file contains 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 | |
func loader() { | |
let line1 = Double(readLine()!)! | |
let line2 = Int(readLine()!)! | |
let line3 = readLine()!.components(separatedBy: " ").map{ Int($0)! } | |
let a = line3[0] | |
let b = line3[1] | |
let line4 = (readLine()!.components(separatedBy: " ").map{ Int($0)! }).sorted(by: { $0 > $1 }) | |
//hrChallenge2(mealCost: line1, tip: line2, tax: line3) | |
} | |
loader() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment