input: Write a function to find the largest prime factor of a given number. If the number is less than 2, return 0 as there are no prime factors.
  assert largest_prime_factor(331) == 331
  assert largest_prime_factor(100) == 5
  assert largest_prime_factor(693) == 11
  assert largest_prime_factor(2) == 2
  assert largest_prime_factor(1) == 0
  assert largest_prime_factor(0) == 0
output: def largest_prime_factor(n):
      if n < 2:
          return 0
      largest = 0
      for i in range(2, int(n**0.5) + 1):
          while n % i == 0:
              largest = i
              n //= i
      if n > 1:
          largest = n
      return largest