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.
For a faster approach, notice that maximum input limit of k is 10^18.
For n=1000, all r>7 exceeds kmax. From this we can conclude that we just need to find that r for which nCr exceeds k.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #53: Combinatoric selections
You are viewing a single comment's thread. Return to all comments →
For a faster approach, notice that maximum input limit of k is 10^18. For n=1000, all r>7 exceeds kmax. From this we can conclude that we just need to find that r for which nCr exceeds k.