Course · Section 10: A Closer Look at Functions · Lecture 137: First-Class and Higher-Order Functions
Implement `factorial(n)` that returns `n!` (n factorial). Assume `n >= 0`. `factorial(0)` is `1`.
+ 1 hidden test run on Submit.
Each call multiplies n by the factorial of n-1, bottoming out at 1.
Run your code to see results.