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.
I really like the computation of the power using logarithm. The observation is very easy to understand, yet I haven't thought of that.
I think the slowest part of the algorithm is the sieve construction so the complexity would be something like O(N * log(log(N))). In this part of your solution, I again found and interesting speed up by starting at i^2 in the inner circle which also makes sense but I always used naive start at i * 2 :)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #5: Smallest multiple
You are viewing a single comment's thread. Return to all comments →
I really like the computation of the power using logarithm. The observation is very easy to understand, yet I haven't thought of that.
I think the slowest part of the algorithm is the sieve construction so the complexity would be something like O(N * log(log(N))). In this part of your solution, I again found and interesting speed up by starting at i^2 in the inner circle which also makes sense but I always used naive start at i * 2 :)