14 lines
297 B
Python
14 lines
297 B
Python
|
|
def search(limit):
|
|
maxi = [0, 0, 0]
|
|
for x in range(1, limit + 1):
|
|
num = 1
|
|
for y in range(limit):
|
|
num *= x
|
|
s = sum(map(lambda x: int(x), str(num)))
|
|
if s > maxi[0]:
|
|
maxi = [s, x, y + 1]
|
|
return maxi
|
|
|
|
print(search(100))
|