Skip to content

Instantly share code, notes, and snippets.

@hisui
Last active April 11, 2016 12:17
Show Gist options
  • Save hisui/34121925a8c186b3efcdf86233ac9e56 to your computer and use it in GitHub Desktop.
Save hisui/34121925a8c186b3efcdf86233ac9e56 to your computer and use it in GitHub Desktop.
let a = [["a","b"],["x","y"]]
let b = a.enumerate().flatMap { (i, a) in a.enumerate().map { (i, $0.0, $0.1) } }
b.forEach { (i, j, e) in
print("a[\(i)][\(j)] = \(e)")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment