input: from typing import List
  
  def largest_square_area(bottomLeft: List[List[int]], topRight: List[List[int]]) -> int:
      """
      There exist n rectangles in a 2D plane. You are given two 0-indexed 2D integer arrays bottomLeft and topRight, both of size n x 2, where bottomLeft[i] and topRight[i] represent the bottom-left and top-right coordinates of the i th rectangle respectively.
  
      You can select a region formed from the intersection of two of the given rectangles. You need to find the largest area of a square that can fit inside this region if you select the region optimally.
  
      Return the largest possible area of a square, or 0 if there do not exist any intersecting regions between the rectangles.
  
      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: 
      max_area = 0
      n = len(bottomLeft)
      
      for i in range(n):
          for j in range(i + 1, n):
              x1 = max(bottomLeft[i][0], bottomLeft[j][0])
              y1 = max(bottomLeft[i][1], bottomLeft[j][1])
              x2 = min(topRight[i][0], topRight[j][0])
              y2 = min(topRight[i][1], topRight[j][1])
              
              if x1 < x2 and y1 < y2:
                  side_length = min(x2 - x1, y2 - y1)
                  max_area = max(max_area, side_length * side_length)
      
      return max_area
  