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 will give a hint to other people trying to get through this by themselves: it's a trivial improvement of the algorithm that one immediately sees, followed by a sanitization of the input. The second part is less obvious, as some people - including myself - don't see it as part of the initial algorithm.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Queries
You are viewing a single comment's thread. Return to all comments →
I will give a hint to other people trying to get through this by themselves: it's a trivial improvement of the algorithm that one immediately sees, followed by a sanitization of the input. The second part is less obvious, as some people - including myself - don't see it as part of the initial algorithm.