Skip to content

Commit

Permalink
20
Browse files Browse the repository at this point in the history
  • Loading branch information
faithByte committed May 21, 2023
1 parent 51844fd commit 9259737
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions #020:Factorial_digit_sum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
def factorial(n):
res = 1;
for i in range (2, n + 1):
res *= i;
return (res);

q = int(input());
for i in range (q):
n = int(input());
n = str(factorial(n));

total = 0;
for j in (n):
total += int(j);

print (int(total));
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,7 @@ ___
Find the maximum sum of numbers that can be obtained by starting at the top of a triangle of numbers and moving to adjacent numbers on the row below, for a given triangle.
___
## <a href=https://www.hackerrank.com/contests/projecteuler/challenges/euler019/problem?isFullScreen> Problem 19: </a> Counting Sundays <sup>[Easy]</sup>
Find the number of Sundays that fell on the first of the month between two dates(both inclusive)
Find the number of Sundays that fell on the first of the month between two dates(both inclusive)
___
## <a href=https://www.hackerrank.com/contests/projecteuler/challenges/euler020/problem?isFullScreen> Problem 20: </a> Factorial digit sum <sup>[Easy]</sup>
Find the sum of the digits in the number N!

0 comments on commit 9259737

Please sign in to comment.