def tail_factorial(
    number: int,
    accumulator: int = 1,
) -> int:
  """Tail Recursive Factorial Function

  Args:
      number (int): [description]
      accumulator (int, optional): [description]. Defaults to 1.

  Returns:
      int: factorial of the number
  """
  if number == 0:
    return accumulator

  return tail_factorial(
      number=number - 1,
      accumulator=accumulator * number,
  )