Python3 99.48% faster
Intuition\n Describe your first thoughts on how to solve this problem. \nIterate over every two pairs and check the maximum overlap size.\n\n# Approach\n Descri
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nIterate over every two pairs and check the maximum overlap size.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def largestSquareArea(self, bottomLeft: List[List[int]], topRight: List[List[int]]) -> int:\n        n, max_len = len(bottomLeft), 0\n        # The first rectangle\n        for i in range(n):\n            \n            # the bottom left and top right points - (1)\n            (x1, y1), (x2, y2) = bottomLeft[i], topRight[i]\n            w1, h1 = x2-x1, y2-y1\n            \n            # the second rectangle\n            for j in range(i+1, n):\n                \n                # the bottom left and top right points - (2)\n                (i1, j1), (i2, j2) = bottomLeft[j], topRight[j]\n                w2, h2 = i2-i1, j2-j1\n                \n                # no overlap\n                if x1 >= i2 or i1 >= x2 or y1 >= j2 or j1 >= y2:\n                    continue\n\n                # one width completely within the other\n                if (i1 >= x1 and x2 >= i2) or (x1 >= i1 and i2 >= x2):\n                    cur_w = min(w1, w2)\n\n                # with some overlap\n                else:\n                    cur_w = min(x2-i1, i2-x1)\n\n                # one height completely within the other\n                if (j1 >= y1 and y2 >= j2) or (y1 >= j1 and j2 >= y2):\n                    cur_h = min(h1, h2)\n\n                # with some overlap\n                else:\n                    cur_h = min(y2-j1, j2-y1)\n                \n                # update the maximum overlap size\n                if min(cur_w, cur_h) > max_len:\n                    max_len = min(cur_w, cur_h)\n        \n        return max_len ** 2\n```
['Python3']