Getting tle in 2 cases

What is the fault in the code

@singh.vishen09 You have to precompute the factorial array and then just use the array to reduce the time.