input: Write a python function to find the largest prime factor of a given number.
  assert find_largest_prime_factor(300)==5
  assert find_largest_prime_factor(13195)==29
  assert find_largest_prime_factor(27)==3
output: def find_largest_prime_factor(n):
      def is_prime(num):
          if num <= 1:
              return False
          if num <= 3:
              return True
          if num % 2 == 0 or num % 3 == 0:
              return False
          i = 5
          while i * i <= num:
              if num % i == 0 or num % (i + 2) == 0:
                  return False
              i += 6
          return True
  
      largest_prime = -1
      # Check for the smallest prime factor and divide n by it
      while n % 2 == 0:
          largest_prime = 2
          n //= 2
      while n % 3 == 0:
          largest_prime = 3
          n //= 3
      # n must be odd at this point so a skip of 2 can be used
      for i in range(5, int(n**0.5) + 1, 6):
          while n % i == 0:
              largest_prime = i
              n //= i
          while n % (i + 2) == 0:
              largest_prime = i + 2
              n //= (i + 2)
      if n > 4 and is_prime(n):
          largest_prime = n
      return largest_prime