[Python] - Find Overlaps and take minimum - Video Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\nThis uses concept for identifying overlaps Leetcode 2446. You can watch that subprobl
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\nThis uses concept for identifying overlaps [Leetcode 2446](https://leetcode.com/problems/determine-if-two-events-have-conflict/). You can watch that subproblem [here](https://youtu.be/53pBLRbMFHo) to understand this better.\n\nYou can watch the complete intuition https://youtu.be/hz-PVb8ErSc\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: `O(n^2)`\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n\n- Space complexity: `O(1)`\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= len(bottomLeft)\n\n        res = 0\n\n        for i in range(n):\n            for j in range(i+1, n):\n                lastStartingX = max(bottomLeft[i][0], bottomLeft[j][0])\n                firstEndingX = min(topRight[i][0], topRight[j][0])\n\n                lastStartingY = max(bottomLeft[i][1], bottomLeft[j][1])\n                firstEndingY = min(topRight[i][1], topRight[j][1])\n\n                if lastStartingX < firstEndingX and lastStartingY < firstEndingY:\n                    side = min(firstEndingX - lastStartingX, firstEndingY - lastStartingY)\n                    res = max(res, side*side)\n\n        return res\n```
['Python3']