Easy Iterative Solution | Python
Complexity\n- Time complexity: O(n^2)\n\n- Space complexity: O(1)\n\n# Code\n\nclass Solution:\n    def largestSquareArea(self, bottomLeft: List[List[int]], top
# Complexity\n- Time complexity: O(n^2)\n\n- Space complexity: O(1)\n\n# Code\n```\nclass Solution:\n    def largestSquareArea(self, bottomLeft: List[List[int]], topRight: List[List[int]]) -> int:\n        ans = 0\n        n = len(bottomLeft)\n        \n        def overlap(R1,R2):\n            if (R1[0]>=R2[2]) or (R1[2]<=R2[0]) or (R1[3]<=R2[1]) or (R1[1]>=R2[3]):\n                return False\n            else:\n                return True\n\n        for i in range(n):\n            for j in range(i+1,n):\n                l1 = bottomLeft[i]\n                r1 = topRight[i]\n                l2 = bottomLeft[j]\n                r2 = topRight[j]\n                \n                x = 0\n                y = 1\n\n                if overlap(l1+r1,l2+r2):\n                    x_dist = (min(r1[x], r2[x]) -\n                              max(l1[x], l2[x]))\n\n                    y_dist = (min(r1[y], r2[y]) -\n                              max(l1[y], l2[y]))\n                    if x_dist > 0 and y_dist > 0:\n                        ans = max(ans,min(x_dist,y_dist)**2)\n                    \n        return ans\n```
['Array', 'Python', 'Python3']