Size the Arrangement Space
Basic SolvedA scheduling estimate needs the number of ways to order n distinct tasks — that is, n factorial. Compute it for small n.
Implement `solve(Integer n)` (0 ≤ n ≤ 12) to return n! (the product 1×2×…×n; 0! is 1).
Examples
Input
n = 5Output
120Input
n = 0Output
1Hints
- Multiply a running product from 1 up to n; start the product at 1 so 0! is 1.
Tests
Your code runs in a secure sandbox against multiple hidden test cases. The problem is solved only when every test passes. Each run is isolated and any data changes are rolled back automatically.