✅Easy C++ solution with O(nlogn) solution!
\n> If you\u2019re interested in coding you can join my Discord Server, link in the comment section. Also if you find any mistake please let me know. Thank you!
\n> **If you\u2019re interested in coding you can join my Discord Server, link in the comment section. Also if you find any mistake please let me know. Thank you!\u2764\uFE0F**\n> \n\n---\n\n## Concept used:\n\n- \n\n---\n\n## Explanation:\n\n### Solution 01\n\n- To get the maximum area, we need to find maximum height & weight.\n- First, sort both array & take 2 variable mxh, mxv to store maximum height and weight.\n- The base case for mxh will take 0 to first element & hc[last] to last element.\n- The product value will be long long, so we need to convert it to int. *[**(((long long)mxv%mod)*((long long)mxh%mod))%mod]***\n- **Time complexity:** O(nlogn).\n\n---\n\n## Code:\n\n```cpp\n//Solution 01:\n**class Solution {\npublic:\n    int maxArea(int h, int w, vector<int>& hc, vector<int>& vc) {\n        int n= hc.size(), m=vc.size();\n        \n        sort(hc.begin(), hc.end());\n        sort(vc.begin(), vc.end());\n        \n        int mxh = max(hc[0]-0 , h-hc[n-1]);\n        int mxv = max(vc[0]-0 , w-vc[m-1]);\n\n        for(int i=1; i<n; i++)\n            mxh = max(mxh, hc[i]-hc[i-1]);   \n     \n        for(int i=1; i<m; i++)\n            mxv = max(mxv, vc[i]-vc[i-1]);\n        \n        int mod = 1e9+7;\n        \n        return (((long long)mxv%mod)*((long long)mxh%mod))%mod;\n    }\n};**\n```\n\n---\n\n> **Please upvote this solution**\n>
['C', 'C++']