|
|
|
|
|
by melling
2389 days ago
|
|
I solved the first part using the examples. Swift is nice. func calcFuel(_ mass:Int) -> Int {mass / 3 - 2}
let z0 = massList.map(calcFuel).reduce(0, +)
or simply ... let z1 = massList.map({$0 / 3 - 2}).reduce(0, +)
Any idea how to read the data on the iPad? |
|