input: Write a function to find the largest prime factor of a given number. The function should return the largest prime factor if the number is greater than 1, otherwise return the number itself. If the number is empty or negative, return "Invalid Input".
  assert largest_prime_factor(331) == 331
  assert largest_prime_factor(13195) == 29
  assert largest_prime_factor(600851475143) == 6857
  assert largest_prime_factor(-1) == "Invalid Input"
  assert largest_prime_factor(0) == "Invalid Input"
  assert largest_prime_factor(1) == 1
output: def largest_prime_factor(n):
      if n is None or n <= 0:
          return "Invalid Input"
      if n == 1:
          return 1
      largest_factor = 1
      divisor = 2
      while n % divisor == 0:
          largest_factor = divisor
          n //= divisor
      divisor = 3
      while n != 1 and divisor * divisor <= n:
          while n % divisor == 0:
              largest_factor = divisor
              n //= divisor
          divisor += 2
      if n > 1:
          largest_factor = n
      return largest_factor