🔥Java Solution || Easy to Understand🔥
Complexity\n- Time complexity: O(N*logN)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n\
# Complexity\n- Time complexity: O(N*logN)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int maxArea(int h, int w, int[] horizontalCuts, int[] verticalCuts) {\n        Arrays.sort(horizontalCuts);\n        Arrays.sort(verticalCuts);\n\n        long maxHightOfPiece = Math.max(horizontalCuts[0], h - horizontalCuts[horizontalCuts.length - 1]);\n        long maxWidthOfPiece = Math.max(verticalCuts[0], w - verticalCuts[verticalCuts.length - 1]);\n\n        for(int i = 1; i < horizontalCuts.length; i++) {\n            maxHightOfPiece = Math.max(maxHightOfPiece, horizontalCuts[i] - horizontalCuts[i-1]);\n        }\n\n        for(int i = 1; i < verticalCuts.length; i++) {\n            maxWidthOfPiece = Math.max(maxWidthOfPiece, verticalCuts[i] - verticalCuts[i-1]);\n        }\n\n        return (int)((maxHightOfPiece * maxWidthOfPiece) % (long)(Math.pow(10, 9) + 7));\n    }\n}\n```
['Java']