input: def largest_prime_factor(n: int) -> int:
      """ Return the largest prime factor of the given number.
      >>> largest_prime_factor(331)
      331
      >>> largest_prime_factor(15)
      5
      >>> largest_prime_factor(60)
      5
      """
output:     if n <= 1:
          return None
      largest_factor = 1
      for i in range(2, int(n**0.5) + 1):
          while n % i == 0:
              largest_factor = i
              n //= i
      if n > 1:
          largest_factor = n
      return largest_factor