Created
March 27, 2019 19:06
-
-
Save michaeleisel/e1a6efc17cc3d3d54d1318fa75e2ddc7 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 f() { | |
let max = range.product(range).maxWith { (topRow, leftCol) -> (Int) in | |
return (0..<3).product(0..<3).map { rowOffset, colOffset in // (rowOffset: Int, colOffset: Int) -> (Int) in | |
return scores[topRow + rowOffset][leftCol + colOffset] | |
}.reduce(0, +) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment