✅C++ Accepted | Simple Sorting ⛳
\n# Code\n\nclass Solution {\npublic:\n    int minRectanglesToCoverPoints(vector<vector<int>>& points, int w) {\n        int n = points.size();\n        sort(po
\n# Code\n```\nclass Solution {\npublic:\n    int minRectanglesToCoverPoints(vector<vector<int>>& points, int w) {\n        int n = points.size();\n        sort(points.begin(),points.end());\n        int left = 0, cnt = 0;\n        for(int i=0;i<n;i++){\n            if(points[i][0]-points[left][0] > w){\n                cnt++;\n                left = i;\n            }\n        }\n        return cnt+1;\n    }\n};\n```
['C++']