[TikTok] OA 2025 Start – 20 Feb (Generic)
Implement a function factorial(n) that calculates the factorial of a