HackerEarth Small Factorials problem solution - TheCScience