Question
Given an integer N, find its factorial.
Example 1:
Input: N = 5
Output: 120
Explanation : 5! = 1*2*3*4*5 = 120
Example 2:
Input: N = 10
Output: 3628800
Explanation :
10! = 1*2*3*4*5*6*7*8*9*10 = 3628800
Expected Time Complexity: O(N2)
Expected Auxilliary Space: O(1)โ
Constraints: 1โคNโค1000