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.
I think its a waste of time to think about efficiency for something like this as well, but the OP wanted to understand efficiency better (hence the nitpicky breakdown) which is understandable as it's an important part of learning to write better code; however, it is important with problems like this to consider whether or not the solution is the best and most appropriately scalable. This is how people learn to program as engineers and not just as someone who has enough limited skill to slap on a short term bandaid solution without understanding the whole picture.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Diagonal Difference
You are viewing a single comment's thread. Return to all comments →
I think its a waste of time to think about efficiency for something like this as well, but the OP wanted to understand efficiency better (hence the nitpicky breakdown) which is understandable as it's an important part of learning to write better code; however, it is important with problems like this to consider whether or not the solution is the best and most appropriately scalable. This is how people learn to program as engineers and not just as someone who has enough limited skill to slap on a short term bandaid solution without understanding the whole picture.