find-the-largest-area-of-square-inside-two-rectangles
Code\n\nclass Solution:\n    def largestSquareArea(self, bottomLeft: List[List[int]], topRight: List[List[int]]) -> int:\n        max_area = 0\n        intersec
# Code\n```\nclass Solution:\n    def largestSquareArea(self, bottomLeft: List[List[int]], topRight: List[List[int]]) -> int:\n        max_area = 0\n        intersected = False\n        for i in range(len(bottomLeft)):\n            for j in range(i+1, len(bottomLeft)):\n                x1 = max(bottomLeft[i][0], bottomLeft[j][0])\n                y1 = max(bottomLeft[i][1], bottomLeft[j][1])\n                x2 = min(topRight[i][0], topRight[j][0]) \n                y2 =min(topRight[i][1], topRight[j][1])\n                if x1 < x2 and y1 < y2:\n                    intersected = True\n                    side_length = min(x2 -x1, y2 - y1)\n                    max_area= max(max_area, side_length*side_length)\n        if intersected == False: \n            return 0\n        return max_area\n        \n```
['Python3']