Skip to content

Instantly share code, notes, and snippets.

@fhorlaville
Created April 2, 2017 23:33
Show Gist options
  • Save fhorlaville/f4388e452ab1f07caef362119da2a14e to your computer and use it in GitHub Desktop.
Save fhorlaville/f4388e452ab1f07caef362119da2a14e to your computer and use it in GitHub Desktop.
HackerRank Swift loader functions, to read the input
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