Im trying to solve this in Python 2.7 but it keeps saying TLE after case 1: https://dmoj.ca/problem/factorial
This is my code:
N=int(input()) x=[] import sys total = 0 def factorial(n): total = n while n > 1: total *= (n - 1) n -= 1 return total for i in range(0,N): c=int(input()) x.append(c) for i in range(0,N): print(((factorial(x[i]))%(2**32)))