C++ || Beginner Friendly || Simple, Short and Easy|| Commented
Upvote if you find it useful\n\nclass Solution {\npublic:\n    int solve(int n ,vector<int>& cuts)\n    {\n   // considering the area formed due to 0 and cuts[0
**Upvote if you find it useful**\n```\nclass Solution {\npublic:\n    int solve(int n ,vector<int>& cuts)\n    {\n   // considering the area formed due to 0 and cuts[0]     \n        int mx=cuts[0];\n        int m=cuts.size();\n  // iterate through both sets and keep track of the maximum difference found between two consecutive cuts   \n        for(int i=1;i<m;i++)\n        {\n            mx=max(mx,cuts[i]-cuts[i-1]);\n        }\n  // dont forget to take the area formed by n and cut[m-1], it can be maximum as in second custom test case      \n        mx=max(mx,n-cuts[m-1]);\n        \n        return mx;\n    }\n    \n    \n    int maxArea(int h, int w, vector<int>& horizontal, vector<int>& vertical) { \n       // To find the largest slice of each, we need to first sort the horizontal cuts and vertical cuts  \n        sort(horizontal.begin(),horizontal.end());\n        sort(vertical.begin(),vertical.end());\n        // to find maximum area we need to find the maximum length  and breadth\n        // calculate lenght and bredth of the rectangle formed\n        long long bredth=solve(h,horizontal);\n        long long length=solve(w,vertical); \n        \n        return  (length*bredth) % 1000000007; \n    }\n};\n```
['Greedy', 'C', 'Sorting', 'C++']