Digits of a Factorial
A factorial grows into a very large number quickly: for example, 10! is the product of all numbers from 1 to 10. Write a function factorial_digit_sum that computes n!, then adds all digits of the result. Remember that 0! is defined as 1.
Примеры
Ввод
10Вывод
27Ввод
100Вывод
648Ввод
0Вывод
1Нужно реализовать
def factorial_digit_sum(n: int) -> int:
Теги
math
Idħol biex tara l-istorja tas-sottomissjonijiet
IdħolIdħol biex tuża l-Mentor tal-AI
IdħolVisible tests
1
Input
10Expected
272
Input
100Expected
6483
Input
0Expected
14
Input
1Expected
15
Input
5Expected
36
Input
9Expected
27Focus radio
Paused · SomaFM · Fluid