Java easy with explanation - Time (nlogn), Space - O(1)
Algorithm\n  The approach is same as that of https://leetcode.com/problems/maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/discuss/661995/Do-
**Algorithm**\n*  The approach is same as that of https://leetcode.com/problems/maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/discuss/661995/Do-you-like-visual-explanation-You-got-it.-%3A-\n*  Sort the `horizontalCuts` and `verticalCuts` array\n*  First we will see the horizontal cuts, to start get the max between the first cut and the difference of the height and the last element\n*  Loop through the remaining elements from index `1` to the `length` and get the `maxHeight` computed. \n*  Do the same for vertical cuts and compute the `maxWidth`\n*  return the product of `maxHeight` and `maxWidth`\n*  Since the test cases are huge we want to convert the area to `long` data type and the result needs to be the `% of 1000000007` \n\n```\nclass Solution {\n    public int maxArea(int h, int w, int[] horizontalCuts, int[] verticalCuts) {\n        \n        Arrays.sort(horizontalCuts);\n        Arrays.sort(verticalCuts);\n        \n        int hLength = horizontalCuts.length;\n        int vLength = verticalCuts.length;\n                \n        int maxHeight = Math.max(horizontalCuts[0]-0, h - horizontalCuts[hLength-1]);\n        for (int i = 1;i<hLength; i++){\n            int diff = horizontalCuts[i] - horizontalCuts[i-1];\n            maxHeight = Math.max(maxHeight, diff);\n        }\n        \n        \n        int maxWidth = Math.max(verticalCuts[0]-0, w - verticalCuts[vLength-1]);\n        for (int i = 1;i<vLength; i++){\n            int diff = verticalCuts[i] - verticalCuts[i-1];\n            maxWidth = Math.max(maxWidth, diff);\n        }\n        \n        long ans = 1L * maxHeight * maxWidth;\n        \n        return  (int) (ans % 1000000007);\n    }\n}\n```
['Java']