Hackerrank – Extra Long Factorials

Problem Statement
A description of the problem can be found on Hackerrank.

Solution
Read input and implement factorial function (recursive or imperative) using Big Integer if desired language does not support automatic conversion to Big Integers by default.

I created solution in 3 languages:

Normally, I implement a solution also in JavaScript. But my solution for this problem is not correct. Large numbers use scientific notation. After trying to format I have had problem with decimal precision.

All solutions are also available on my GitHub.

Scala

Java

Ruby