C++ | Python | Easy
C++\n\nclass Solution {\npublic:\n    int maxdiff(vector<int>v, int length) {\n        sort(v.begin(),v.end());\n        int max_diff=v[0];\n        for(int i=1
# C++\n```\nclass Solution {\npublic:\n    int maxdiff(vector<int>v, int length) {\n        sort(v.begin(),v.end());\n        int max_diff=v[0];\n        for(int i=1;i<v.size();i++) {\n            max_diff=max(max_diff,v[i]-v[i-1]);\n        }\n        max_diff=max(max_diff,length-v.back());\n        return max_diff;\n    }\n    int maxArea(int h, int w, vector<int>& horizontalCuts, vector<int>& verticalCuts) {\n        int mod=1e9+7;\n        long max_h=maxdiff(horizontalCuts,h);\n        long max_v=maxdiff(verticalCuts,w);\n        return((max_h*max_v)%mod);\n    }\n};\n```\n\n# Python\n```\nclass Solution:\n    def maxArea(self, h: int, w: int, horizontalCuts: List[int], verticalCuts: List[int]) -> int:\n        mod = int(1e9 + 7)\n        horizontalCuts.sort()\n        verticalCuts.sort()\n        horizontalCuts.append(h)\n        verticalCuts.append(w)\n        mh = horizontalCuts[0]\n        mv = verticalCuts[0]\n        for i in range(len(horizontalCuts) - 1):\n            mh = max(mh, horizontalCuts[i+1] - horizontalCuts[i]) \n        for i in range(len(verticalCuts) - 1):\n            mv = max(mv, verticalCuts[i+1] - verticalCuts[i])\n        return (mh*mv)%mod\n```
['Greedy', 'C', 'Sorting', 'Python']