C++ || EASY CLEAN SHORT CODE
\n# Code\n\nclass Solution {\npublic:\n    int minRectanglesToCoverPoints(vector<vector<int>>& p, int w) {\n        vector<int> a;\n        for(auto i : p) a.pu
\n# Code\n```\nclass Solution {\npublic:\n    int minRectanglesToCoverPoints(vector<vector<int>>& p, int w) {\n        vector<int> a;\n        for(auto i : p) a.push_back(i[0]);\n        sort(a.begin(),a.end());\n\n        int c=0,m=w;\n        for(int i=1;i<a.size();i++)\n        {\n            if(a[i]-a[i-1]<=m)\n            m-=a[i]-a[i-1];\n            else {\n                m=w;\n                c++;\n            }\n        }\n        c++;\n        return c;\n    }\n};\n```
['C++']