Python3 EASY 2 lines with visual examples
python\ndef maxArea(self, h: int, w: int, horizontalCuts: List[int], verticalCuts: List[int]) -> int:\n    getMaxSpace = lambda cuts, end: max([cuts[0]] + [end-
```python\ndef maxArea(self, h: int, w: int, horizontalCuts: List[int], verticalCuts: List[int]) -> int:\n    getMaxSpace = lambda cuts, end: max([cuts[0]] + [end-cuts[-1]] + [cuts[i] - cuts[i-1] for i in range(1, len(cuts))])\n    return getMaxSpace(sorted(horizontalCuts), h) * getMaxSpace(sorted(verticalCuts), w) % (10**9+7)\n```\n\ngetMaxSpace() finds the maximum distance between two cuts for a particular dimension.\n\nThe solution is to find the maximum space for the vertical and horizontal dimensions, multiply them and return its remainder with 10^9 - 7 (the last part is based on the question\'s requirements).\n\nThe cuts need to be sorted because to find the maximum space, the function compares each cut with its neighbour: ```cuts[i] - cuts[i-1]```.\n\nIf the maximum space is between the first cut and the origin, simply return the first cut (```cuts[0]```). If the maximum space is between the end and the last cut, return ```end - cuts[-1]```.\n\n**Examples**\n![image](https://assets.leetcode.com/users/images/f9be5c34-54be-46ea-9042-d88024217bd4_1643069893.0644438.png)\n\n![image](https://assets.leetcode.com/users/images/f007b692-6107-4800-92b6-84bf7d4c6450_1643069893.0524411.png)\n\n**Longer code**\n```python\nclass Solution:\n    def getMaxSpace(self, cuts: List[int], end: int) -> int:\n        maxSpace = max(cuts[0], end-cuts[-1])\n        for i in range(1,len(cuts)):\n            maxSpace = max(maxSpace, cuts[i] - cuts[i-1])\n        return maxSpace\n    def maxArea(self, h: int, w: int, horizontalCuts: List[int], verticalCuts: List[int]) -> int:\n        return self.getMaxSpace(sorted(horizontalCuts), h) * self.getMaxSpace(sorted(verticalCuts), w) % (10**9+7)\n```
['Python', 'Python3']