You are viewing a single comment's thread. Return to all comments →
you use n just for counting then 2 * (10 6) - 1 is evaluating every time
for improve that: you can directly start with that big num & decrees it value, up to 2
or shift that range 2 bit, so only need to check is >0 or not. is this python so, only if n: print("")
it not give you that much less time, but consume little less than yours
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Project Euler #104: Pandigital Fibonacci ends
You are viewing a single comment's thread. Return to all comments →
you use n just for counting then 2 * (10 6) - 1 is evaluating every time
for improve that: you can directly start with that big num & decrees it value, up to 2
or shift that range 2 bit, so only need to check is >0 or not. is this python so, only if n: print("")
it not give you that much less time, but consume little less than yours