CT090

Factorial Digit Sum

EasyAcceptance: 0.0%

n! means n x (n-1) x ... x 3 x 2 x 1. For example, 10! = 3628800, and the sum of its digits is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27. Given n, find the sum of the digits of n!.

Example 1:

Input: 10
Output: 27

Example 2:

Input: 100
Output: 648

Example 3:

Input: 50
Output: 216

Constraints:

1 <= n <= 1000

Tags:

math factorial digit-sum big-numbers
Loading...
Test Cases:No test cases
No test cases available.