input: Write a python function that takes two lists, bottomLeft and topRight, each of size n x 2 representing the bottom-left and top-right coordinates of n rectangles on a 2D plane. The function should return the largest possible area of a square that can fit inside the intersection of any two given rectangles, or 0 if no such intersecting regions exist.
  
  from typing import List
  
  def max_square_in_intersection(bottomLeft: List[List[int]], topRight: List[List[int]]) -> int:
      """
      You are given two 0-indexed 2D integer arrays bottomLeft and topRight, representing the bottom-left and top-right coordinates of n rectangles respectively.
  
      Determine the maximum area of a square that can be contained within the intersecting regions of two rectangles if chosen optimally.
  
      Return the maximum square area possible or 0 if there are no intersecting regions.
  
      Examples:
      >>> bottomLeft = [[1,1],[2,2],[3,1]], topRight = [[3,3],[4,4],[6,6]]
      1
      >>> bottomLeft = [[1,1],[2,2],[1,2]], topRight = [[3,3],[4,4],[3,4]]
      1
      >>> bottomLeft = [[1,1],[3,3],[3,1]], topRight = [[2,2],[4,4],[4,2]]
      0
  
      Constraints:
      n == bottomLeft.length == topRight.length
      2 <= n <= 10^3
      bottomLeft[i].length == topRight[i].length == 2
      1 <= bottomLeft[i][0], bottomLeft[i][1] <= 10^7
      1 <= topRight[i][0], topRight[i][1] <= 10^7
      bottomLeft[i][0] < topRight[i][0]
      bottomLeft[i][1] < topRight[i][1]
      """
output: def max_square_in_intersection(bottomLeft: List[List[int]], topRight: List[List[int]]) -> int:
      max_side = 0
      n = len(bottomLeft)
      
      for i in range(n):
          for j in range(i + 1, n):
              lx1, ly1 = bottomLeft[i]
              rx1, ry1 = topRight[i]
              lx2, ly2 = bottomLeft[j]
              rx2, ry2 = topRight[j]
              
              ix_left = max(lx1, lx2)
              ix_right = min(rx1, rx2)
              iy_bottom = max(ly1, ly2)
              iy_top = min(ry1, ry2)
              
              if ix_left < ix_right and iy_bottom < iy_top:
                  side_max = min(ix_right - ix_left, iy_top - iy_bottom)
                  max_side = max(max_side, side_max)
                  
      return max_side ** 2 if max_side > 0 else 0