Write a function to calculate the factorial of a number recursively.
MediumProblem Statement
Write a function to calculate the factorial of a number recursively.
Sample Input
n = 5
Sample Output
120
Limits
Time: 2s · Memory: 256 MB
Write a function to calculate the factorial of a number recursively.
n = 5
120
Time: 2s · Memory: 256 MB