Walmart interview question

Factorial numbers calculation optimizations