input: Write a python function to generate an array containing the first n prime numbers.
  assert generatePrimeArray(10) == [2, 3, 5, 7]
  assert generatePrimeArray(20) == [2, 3, 5, 7, 11, 13, 17, 19]
  assert generatePrimeArray(30) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
output: def generatePrimeArray(n):
      def is_prime(num):
          if num <= 1:
              return False
          for i in range(2, int(num**0.5) + 1):
              if num % i == 0:
                  return False
          return True
      
      primes = []
      candidate = 2
      while len(primes) < n:
          if is_prime(candidate):
              primes.append(candidate)
          candidate += 1
      return primes