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.
Your solution is good, works in many languages, but int Java 7 it times out for some test cases, so in that language a faster solution is needed. Seems to me that the timeout period may have been too short because your solution is O(log(n)).
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Strange Counter
You are viewing a single comment's thread. Return to all comments →
Your solution is good, works in many languages, but int Java 7 it times out for some test cases, so in that language a faster solution is needed. Seems to me that the timeout period may have been too short because your solution is O(log(n)).