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.
Can someone please point to the technique that is used for this problem? I have a submission that works for small values of N but breaks down hopelessly for large values .. I could try to use log , but I have no idea how to calculate the lower n digits in that case.
I took a look at the editorial but was unable to make out from the code what mathematical technique was used to solve this problem.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Journey to Mars
You are viewing a single comment's thread. Return to all comments →
Can someone please point to the technique that is used for this problem? I have a submission that works for small values of N but breaks down hopelessly for large values .. I could try to use log , but I have no idea how to calculate the lower n digits in that case. I took a look at the editorial but was unable to make out from the code what mathematical technique was used to solve this problem.