STMicroelectronics interview question

Write Factorial with optimized solution, suduko solver