input: Write a python function to find the largest prime factor of the product of an array of integers.
  assert largest_prime_factor([10, 15]) == 5
  assert largest_prime_factor([3, 5, 7]) == 7
  assert largest_prime_factor([2, 4, 8]) == 2
  assert largest_prime_factor([11, 13, 17]) == 17
output: def largest_prime_factor(arr):
      import math
  
      def is_prime(n):
          if n <= 1:
              return False
          if n <= 3:
              return True
          if n % 2 == 0 or n % 3 == 0:
              return False
          i = 5
          while i * i <= n:
              if n % i == 0 or n % (i + 2) == 0:
                  return False
              i += 6
          return True
  
      def max_prime_factor(n):
          max_prime = -1
          while n % 2 == 0:
              max_prime = 2
              n //= 2
          for i in range(3, int(math.sqrt(n)) + 1, 2):
              while n % i == 0:
                  max_prime = i
                  n //= i
          if n > 2:
              max_prime = n
          return max_prime
  
      product = 1
      for num in arr:
          product *= num
  
      return max_prime_factor(product)