✅Python | Maximum Gaps | O(mlogm + nlogn) | Clean Code
\nclass Solution:\n    def maxArea(self, h: int, w: int, hCuts: List[int], vCuts: List[int]) -> int:\n        hCuts = [0]+sorted(hCuts)+[h]\n        vCuts = [0]
```\nclass Solution:\n    def maxArea(self, h: int, w: int, hCuts: List[int], vCuts: List[int]) -> int:\n        hCuts = [0]+sorted(hCuts)+[h]\n        vCuts = [0]+sorted(vCuts)+[w]\n        hgap = max(hCuts[i+1] - hCuts[i] for i in range(len(hCuts)-1))\n        vgap = max(vCuts[i+1] - vCuts[i] for i in range(len(vCuts)-1))\n        return hgap*vgap%(10**9 + 7)\n```\nSimplified the solution above like the following\n```\nclass Solution:\n    def maxArea(self, h: int, w: int, hCuts: List[int], vCuts: List[int]) -> int:\n        def findMaxGap(cuts, end):\n            cuts = [0]+sorted(cuts)+[end]\n            return max(cuts[i+1] - cuts[i] for i in range(len(cuts)-1))\n        return findMaxGap(hCuts, h)*findMaxGap(vCuts, w)%(10**9 + 7)
['Python']