input: def largest_prime_factor(n: int) -> int:
      """Find the largest prime factor of a given number.
      >>> largest_prime_factor(330)
      11
      >>> largest_prime_factor(13195)
      29
      """
output:     if n <= 1:
          return None
      largest_factor = 1
      divisor = 2
      while n >= divisor * divisor:
          while (n % divisor) == 0:
              largest_factor = divisor
              n //= divisor
          divisor += 1
      if n > 1:
          largest_factor = n
      return largest_factor