Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts
class Solution {\n   public int maxArea(int h, int w, int[] x, int[] y) {\n    Arrays.sort(x);\n    Arrays.sort(y);\n    int maxX = x[0], maxY = y[0];\n    for 
class Solution {\n   public int maxArea(int h, int w, int[] x, int[] y) {\n    Arrays.sort(x);\n    Arrays.sort(y);\n    int maxX = x[0], maxY = y[0];\n    for (int i = 1; i < x.length; i++) {\n        maxX = Math.max(maxX, x[i] - x[i - 1]);\n    }\n    maxX = Math.max(maxX, h - x[x.length - 1]);\n    for (int i = 1; i < y.length; i++) {\n        maxY = Math.max(maxY, y[i] - y[i - 1]);\n    }\n    maxY = Math.max(maxY, w - y[y.length - 1]);\n    return (int) ((long) maxX * (long)maxY % 1000000007L);\n}\n        \n    }\n
['Array', 'Sorting']