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.
this could also be a good solution, easiest one in short of problems :')
n = int(input())
a = 10 ** (n-1)
b = 10 ** (n)
k = int(math.ceil(pow(a, 1/n)))
ans = 0
while(k ** n < b):
ans += 1
print(k ** n)
k += 1
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #63: Powerful digit counts
You are viewing a single comment's thread. Return to all comments →
this could also be a good solution, easiest one in short of problems :') n = int(input()) a = 10 ** (n-1) b = 10 ** (n) k = int(math.ceil(pow(a, 1/n))) ans = 0 while(k ** n < b): ans += 1 print(k ** n) k += 1