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.
Did it with python3 and really had to squeeze everything out to get it under time. However, interesting to note that only about 25% of the time was spent in divisibility tests. A lot of little stuff was killing me, binary search and sorting, and both could probably be eliminated. I think you could get close to 1 second on 18 and 19 in C.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #51: Prime digit replacements
You are viewing a single comment's thread. Return to all comments →
Did it with python3 and really had to squeeze everything out to get it under time. However, interesting to note that only about 25% of the time was spent in divisibility tests. A lot of little stuff was killing me, binary search and sorting, and both could probably be eliminated. I think you could get close to 1 second on 18 and 19 in C.