Easy · Math
Factorial number
Given an integer n ≤ 20, return n!, the product of the integers 1 through n (with 0! = 1), or 0 when n is negative.
Examples
Example 1
n = 5Output: 5! = 120
Example 2
n = 0Output: 0! = 1
Rebuild it in the studio
Read every interview problem free. Ten rooms need no account. A token opens a problem in full — Pro never counts.