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.
if x == 1:
return 1
if x % 2 == 0:
return is_hamming_numbers(x / 2)
if x % 3 == 0:
return is_hamming_numbers(x / 3)
if x % 5 == 0:
return is_hamming_numbers(x / 5)
return 0
c = 1
for i in range(1, 100000000):
if is_hamming_numbers(i) == True:
I am getting timeout errors here
c += 1
print(c)
`
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #204: Generalised Hamming Numbers
You are viewing a single comment's thread. Return to all comments →
I am getting timeout errors here