
Sum neighbors of a given index in a bi dimensional matrix in Swift
I was solving this problem a couple days ago and I decided to post it here, so maybe I can help someone facing something similar.
Basically given a two dimensions matrix of numbers, we have to sum the value of the neighbors of an also given index. The index will be constituted of a line and column. Let's see an example of matrix that could be used in…