Created
October 2, 2019 15:57
-
-
Save RoastBeefKazenakis/5494ed6c9c932bc4d1849a438220ee69 to your computer and use it in GitHub Desktop.
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
func sumAndProduct(sum: Int, product: Int) -> [Int] { | |
let number1 = Double(sum) * 0.5 | |
let x = Double(sum) - number1 | |
let y = number1 | |
return [Int(x), Int(y)] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment