Task Description
Create a function that calculates the factorial of a number.
Requirements:
- Function should be named `factorial`
- Should accept one parameter `n`
- Should return the factorial of n
- Handle edge cases (n = 0, n = 1)
Examples:
factorial(0) // returns 1
factorial(1) // returns 1
factorial(5) // returns 120