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.
That was the thing. Misleading pre provided scanning code. It scans by columns - not by rows - which I assume most would not expect. I was so sure mine was right but had no idea why certain test cases were failing. Only thing I had to change was to switch the for statements (outer to inner and inner to outer) and all test cases passed.
Yours is the most observant and helpful comment. Thanks much
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
2D Array - DS
You are viewing a single comment's thread. Return to all comments →
That was the thing. Misleading pre provided scanning code. It scans by columns - not by rows - which I assume most would not expect. I was so sure mine was right but had no idea why certain test cases were failing. Only thing I had to change was to switch the for statements (outer to inner and inner to outer) and all test cases passed.
Yours is the most observant and helpful comment. Thanks much