Created
January 16, 2020 15:39
-
-
Save AppleCEO/20c043a9dd3982545f55c0726cd3293b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 solution(_ arr1:[[Int]], _ arr2:[[Int]]) -> [[Int]] { | |
| var i = 0, j = 0 | |
| return arr1.map { (numbers) -> [Int] in | |
| defer { | |
| i += 1 | |
| j = 0 | |
| } | |
| return numbers.map { (number) -> Int in | |
| defer { | |
| j += 1 | |
| } | |
| return number + arr2[i][j] | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment