Return n!, the product of all positive integers from 1 through n. By definition, 0! = 1.
Input / output
n: integerExamples
n = 0 returns 1.n = 5 returns 120.Constraints
0 <= n <= 12 so the result fits a 32-bit signed integerFollow-up What overflow and recursion-depth issues appear when the input range grows?