Biggest Power Digit Sum
Powers can grow into huge numbers very quickly, but sometimes the interesting part is the sum of their digits. Write a function max_powerful_digit_sum that checks values of a^b where both a and b are less than n. Find the largest digit sum among them. Return that maximum.
Примеры
Ввод
100Вывод
972Ввод
10Вывод
45Ввод
5Вывод
13Нужно реализовать
def max_powerful_digit_sum(n: int) -> int:
Теги
math
Kirjaudu sisään nähdäksesi palautushistorian
Kirjaudu sisäänKirjaudu sisään käyttääksesi tekoälymentoria
Kirjaudu sisäänVisible tests
1
Input
100Expected
9722
Input
10Expected
453
Input
5Expected
134
Input
2Expected
15
Input
99Expected
9706
Input
0Expected
0Focus radio
Paused · SomaFM · Fluid