Easy C++ solution
\n\nclass Solution {\npublic:\n    int minRectanglesToCoverPoints(vector<vector<int>>& points, int w) {\n\n        int total_rec=1;\n\n        sort(points.begin
\n```\nclass Solution {\npublic:\n    int minRectanglesToCoverPoints(vector<vector<int>>& points, int w) {\n\n        int total_rec=1;\n\n        sort(points.begin(),points.end());\n\n        int start_rec=points[0][0];\n\n        for(auto it:points){\n            if(it[0]<=start_rec+w) continue;\n            else {\n                start_rec=it[0];\n                total_rec++;\n            }\n        }\n\n\n        return total_rec;\n        \n    }\n};\n```
['C++']