Factorials
Modify the following function to return a list of factorials for all the numbers passed to it. You should define an inner function
factorial(n)
that would compute the factorial for a given number n
. As a reminder, the factorial of n
is the product of all the natural numbers before n
:def factorials(*numbers):
def factorial(n):
...
# Create a list of factorials here
return res
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB