Please enter your email address or userHandle.
Given a positive integer, N. Find the factorial of N.
N = 5
5*4*3*2*1 = 120
N = 4
4*3*2*1 = 24
You don't need to read input or print anything. Your task is to complete the function factorial() which takes an integer N as input parameters and returns an integer, the factorial of N.
Expected Time Complexity: O(N)
Expected Space Complexity: O(1)
0 <= N <= 18
We strongly recommend solving this problem on your own before viewing its editorial. Do you still
want to view the editorial?
Login to access your submissions.