Large Factorials
Description:
In mathematics, the factorial of integer n
is written as n!
. It is equal to the product of n
and every integer preceding it. For example: 5! = 1 x 2 x 3 x 4 x 5 = 120
Your mission is simple: write a function that takes an integer n
and returns the value of n!
.
You are guaranteed an integer argument. For any values outside the non-negative range, return null
, nil
or None
(return an empty string ""
in C and C++). For non-negative numbers a full length number is expected for example, return 25! = "15511210043330985984000000"
as a string.
For more on factorials, see http://en.wikipedia.org/wiki/Factorial
NOTES:
The use of BigInteger or BigNumber functions has been disabled, this requires a complex solution
I have removed the use of require in the javascript language.
Similar Kata:
Stats:
Created | Jun 15, 2015 |
Published | Jun 19, 2015 |
Warriors Trained | 29863 |
Total Skips | 7553 |
Total Code Submissions | 99776 |
Total Times Completed | 9477 |
JavaScript Completions | 3004 |
C# Completions | 1079 |
C++ Completions | 1734 |
Java Completions | 3034 |
C Completions | 681 |
NASM Completions | 5 |
Rust Completions | 104 |
Total Stars | 918 |
% of votes with a positive feedback rating | 87% of 1259 |
Total "Very Satisfied" Votes | 985 |
Total "Somewhat Satisfied" Votes | 216 |
Total "Not Satisfied" Votes | 58 |