We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It's simple but very bound to this specific case, if the size of the input was changed you would it would result in a near rewrite.
I like the solutions below that have two sets of loops, those would be easier to extend to new matrix sizes with little code change and are still fairly simple to read.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 11: 2D Arrays
You are viewing a single comment's thread. Return to all comments →
It's simple but very bound to this specific case, if the size of the input was changed you would it would result in a near rewrite.
I like the solutions below that have two sets of loops, those would be easier to extend to new matrix sizes with little code change and are still fairly simple to read.