Search interval separate for x and for y
\n# Complexity\no(n^2);\n\n- Space complexity:\nO(n+m) \n\n# Code\n\nclass Solution:\n    def largestSquareArea(self, bottomLeft: List[List[int]], topRight: Lis
\n# Complexity\n$$o(n^2);$$\n\n- Space complexity:\n$$O(n+m)$$ \n\n# Code\n```\nclass Solution:\n    def largestSquareArea(self, bottomLeft: List[List[int]], topRight: List[List[int]]) -> int:\n        ans = 0\n        \n        for i in range(len(bottomLeft)):\n            ax = [bottomLeft[i][0], topRight[i][0]]\n            ay = [bottomLeft[i][1], topRight[i][1]]\n            \n            for j in range(i+1, len(bottomLeft)):\n                bx = [bottomLeft[j][0], topRight[j][0]]\n                by = [bottomLeft[j][1], topRight[j][1]]\n                \n                x_inter = min(ax[1], bx[1]) - max(ax[0], bx[0])\n                y_inter = min(ay[1], by[1]) - max(ay[0], by[0])\n                \n                if x_inter > 0 and y_inter > 0:\n                    side = min(x_inter, y_inter)\n                    ans = max(ans, side*side)\n                    \n        return ans\n\n                \n\n            \n        \n```
['Python3']