The Startup
Published in

The Startup

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…

--

--

--

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +756K followers.

Recommended from Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alcivanio (Swift)

Alcivanio (Swift)

Computer Engineer + iOS Engineer. I am interested in Swift, Kotlin, Firebase, Data Structures, ASO & On Solving Real World Problems.

More from Medium

White thread in a needle splitting into multi-colored threads