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.
(Python) Spent a long time reading on fast modular exponentiation, implement a lengthy solution which is still not fast enough for the last test case, and then find out someone else use pow() in place of ** to pass everything naively. Lesson learnt. By the way, it took 2.13s for my lengthy solution to pass #4. Interesting, though.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #48: Self powers
You are viewing a single comment's thread. Return to all comments →
(Python) Spent a long time reading on fast modular exponentiation, implement a lengthy solution which is still not fast enough for the last test case, and then find out someone else use
pow()
in place of**
to pass everything naively. Lesson learnt. By the way, it took 2.13s for my lengthy solution to pass #4. Interesting, though.