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.
Imagine that I'm giving you an upvote for pointing out what I missed but also giving you a downvote for explaining all of your algorithm except for the one non-obvious part (the inclusion of i).
Also, we only need to try i from 0 to 2 inclusive. Anything more cannot give us a better alignment.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Equal
You are viewing a single comment's thread. Return to all comments →
Imagine that I'm giving you an upvote for pointing out what I missed but also giving you a downvote for explaining all of your algorithm except for the one non-obvious part (the inclusion of i).
Also, we only need to try i from 0 to 2 inclusive. Anything more cannot give us a better alignment.