C++ || 95% faster || Easy to Understand || Greedy
class Solution {\npublic:\n    long long int maxArea(int h, int w, vector& horizontalCuts, vector& verticalCuts) {\n        \n        \n        //here we insert
class Solution {\npublic:\n    long long int maxArea(int h, int w, vector<int>& horizontalCuts, vector<int>& verticalCuts) {\n        \n        \n        //here we insert the the last length and width bcz they can also be vertical and horizontal cuts as well\n        \n        horizontalCuts.push_back(h);\n        verticalCuts.push_back(w);\n        \n        \n        // sort both the cuts\n        sort(horizontalCuts.begin(),horizontalCuts.end());\n        sort(verticalCuts.begin(),verticalCuts.end());\n        \n        //starting cut at 0\n        long long int prev=0;\n        \n        long long int hrlen=INT_MIN;\n        \n        // clculating maximum adjacent length\n        for(int i=0;i<horizontalCuts.size();i++){\n            hrlen=max(hrlen,abs(horizontalCuts[i]-prev));\n            \n            prev=horizontalCuts[i];\n        }\n        long long int vrlen=INT_MIN;\n        prev=0;\n         // clculating maximum adjacent length\n        for(int i=0;i<verticalCuts.size();i++){\n            vrlen=max(vrlen,abs(verticalCuts[i]-prev));\n            \n            prev=verticalCuts[i];\n        }\n        //cout<<vrlen<<" "<<hrlen;\n        \n        //since ans can be very large so return modulo\n        return (vrlen*hrlen)%1000000007;\n        \n    }\n};\n\n\n//please Upvote it if you like it
['Greedy', 'C', 'Sorting', 'C++']