Skip to content

Instantly share code, notes, and snippets.

@AppleCEO
Created January 17, 2020 14:41
Show Gist options
  • Select an option

  • Save AppleCEO/3267715ea7dc4058e554ccc732c48306 to your computer and use it in GitHub Desktop.

Select an option

Save AppleCEO/3267715ea7dc4058e554ccc732c48306 to your computer and use it in GitHub Desktop.
func solution(_ x:Int, _ n:Int) -> [Int64] {
let result = Array<Int>.init(repeating: 0, count: n)
var index = 0
return result.map { (_) -> Int64 in
index += 1
return Int64(index*x)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment