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.
Only one question with this approach - how would it work if A and B upper limits would be pushed to, say, 10^12?
And N would stay relatively small. Even less than 10.
Then your approach would be at least not very economical.
Of course, the problem as it was defined is solved. But you could have mentioned to the less enlightened that they should think of other ways to compare arrays on account of change in conditions.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Beautiful Pairs
You are viewing a single comment's thread. Return to all comments →
Only one question with this approach - how would it work if A and B upper limits would be pushed to, say, 10^12? And N would stay relatively small. Even less than 10. Then your approach would be at least not very economical.
Of course, the problem as it was defined is solved. But you could have mentioned to the less enlightened that they should think of other ways to compare arrays on account of change in conditions.