C++ sort & max gaps
Time Complexity = O(n log n) \n\nadd the cake boundaries to the vectors.  i.e. 0 and h/w.\n\nsort\n\ntake max gaps\n\nmultiply max gaps by each other\n\nSOLVED 
Time Complexity = O(n log n) \n\nadd the cake boundaries to the vectors.  i.e. 0 and h/w.\n\nsort\n\ntake max gaps\n\nmultiply max gaps by each other\n\n**SOLVED LIVE ON TWITCH.  Everyday 6pm PT.  Link in profile**\n\n```\nclass Solution {\npublic:\n    int maxArea(int h, int w, vector<int>& horizontalCuts, vector<int>& verticalCuts) {\n        sort(horizontalCuts.begin(), horizontalCuts.end());\n        sort(verticalCuts.begin(), verticalCuts.end());\n        \n        int bestHGap = 0;\n        int bestVGap = 0;\n        int prevVert = 0;\n        int prevHorizontal = 0;\n        \n        horizontalCuts.push_back(h);\n        verticalCuts.push_back(w);\n        \n        for(int x : horizontalCuts) {\n            bestHGap = max(bestHGap, x - prevHorizontal);\n            prevHorizontal = x;\n        }\n        \n        for(int y : verticalCuts) {\n            bestVGap = max(bestVGap, y - prevVert);\n            prevVert = y;\n        }\n        \n        int ans = ((long long)bestVGap * bestHGap) % 1000000007;\n        \n        return ans; \n    }\n};\n```
[]