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.
All circular primes less than 10^6 can be found and sorted in under 0.5 seconds using Python 3. Here are some tips.
Using this hint along with your sieve will save a ton of time.
If you keep your prime and circular prime lists sorted, use the bisect module to search for and insert items. For sorted lists, it is faster than
if x in y
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #35: Circular primes
You are viewing a single comment's thread. Return to all comments →
All circular primes less than 10^6 can be found and sorted in under 0.5 seconds using Python 3. Here are some tips.
if x in y