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
PostgreSQLv16

Aici va apărea rezultatul execuției codului

Visible tests
1
Input
10
Expected27
2
Input
100
Expected648
3
Input
0
Expected1
4
Input
1
Expected1
5
Input
5
Expected3
6
Input
9
Expected27
Focus radio
Paused · SomaFM · Fluid