def factorial(n):
	"""
	Returns the factorial of the input integer

	Time complexity: O(n)

	Space complexity: O(n)
	"""

	assert n >= 0, f"Input value {n} is not a positive integer."

	if n <= 1:
		return 1
	return n * factorial(n - 1)