Coding basics · 8 of 20
Factorial
Return n! = 1 × 2 × … × n. By definition 0! is 1.
Examples
Input n = 5
Output 120
Input n = 0
Output 1
Coding basics · 8 of 20
Return n! = 1 × 2 × … × n. By definition 0! is 1.
Input n = 5
Output 120
Input n = 0
Output 1