✅  Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts | Simple Solution
\nclass Solution {\npublic:\n    const int mod = 1e9+7;\n    \n    int getMaxAreaWithCuts(vector<int> &v,int maxVal)\n    {\n        sort(v.begin(),v.end());\n 
```\nclass Solution {\npublic:\n    const int mod = 1e9+7;\n    \n    int getMaxAreaWithCuts(vector<int> &v,int maxVal)\n    {\n        sort(v.begin(),v.end());\n        int maxDif = v[0];\n        for(int i=1;i<(int)v.size();i++)\n            maxDif = max(maxDif,v[i]-v[i-1]);\n        \n        maxDif = max(maxDif,maxVal-v.back());\n        return maxDif;\n    }\n    \n    int maxArea(int h, int w, vector<int>& horizontalCuts, vector<int>& verticalCuts) \n    {\n        int maxDiffWithHorizontalCuts = getMaxAreaWithCuts(horizontalCuts,h);\n        int maxDiffWithVerticalCuts = getMaxAreaWithCuts(verticalCuts,w);\n        return ((long long)maxDiffWithHorizontalCuts % mod * (long long)maxDiffWithVerticalCuts % mod)%mod;\n    }\n};\n```
['C', 'Sorting']