7 kyu
Sum Factorial
1,835 of 3,338Alpri Else
Description:
Factorials are often used in probability and are used as an introductory problem for looping constructs. In this kata you will be summing together multiple factorials.
Here are a few examples of factorials:
4 Factorial = 4! = 4 * 3 * 2 * 1 = 24
6 Factorial = 6! = 6 * 5 * 4 * 3 * 2 * 1 = 720
In this kata you will be given a list of values that you must first find the factorial, and then return their sum.
For example if you are passed the list [4, 6]
the equivalent mathematical expression would be 4! + 6!
which would equal 744
.
Good Luck!
Note: Assume that all values in the list are positive integer values > 0 and each value in the list is unique.
Also, you must write your own implementation of factorial, as you cannot use the built-in math.factorial()
method.
Algorithms
Similar Kata:
Stats:
Created | Feb 2, 2016 |
Published | Feb 3, 2016 |
Warriors Trained | 4929 |
Total Skips | 44 |
Total Code Submissions | 7645 |
Total Times Completed | 3338 |
Python Completions | 1835 |
C++ Completions | 424 |
Ruby Completions | 139 |
Haskell Completions | 64 |
C Completions | 106 |
JavaScript Completions | 888 |
Total Stars | 27 |
% of votes with a positive feedback rating | 92% of 524 |
Total "Very Satisfied" Votes | 454 |
Total "Somewhat Satisfied" Votes | 57 |
Total "Not Satisfied" Votes | 13 |