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.
You may use wheel factorization and the divisor function. It is a bit tricky, but the resulting code is not too much complicated (just two cycles). Implementing the sieve, you have not to test if the divisor is actually prime.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 19: Interfaces
You are viewing a single comment's thread. Return to all comments →
You may use wheel factorization and the divisor function. It is a bit tricky, but the resulting code is not too much complicated (just two cycles). Implementing the sieve, you have not to test if the divisor is actually prime.