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.
If this helps anyone:
1. Don't use sieve of eratosthenes as it gives memory error instead use is_prime function
2. Use direct "12","123",...strings in a list
3. Find all permutations of above string outside the for loop in separate generalized function
4. Use binary search. I got time error in last 4 but was fixed after using binary search
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #41: Pandigital prime
You are viewing a single comment's thread. Return to all comments →
If this helps anyone: 1. Don't use sieve of eratosthenes as it gives memory error instead use is_prime function 2. Use direct "12","123",...strings in a list 3. Find all permutations of above string outside the for loop in separate generalized function 4. Use binary search. I got time error in last 4 but was fixed after using binary search