💯Clean Code || ⚡🔥O(1) SC || 🌟Greedy
\n# Complexity\n\n- Time complexity:\nO(nlogn)\n\n- Space complexity:\nO(1)\n\n\n# Code\n## Please Upvote if it helps\uD83E\uDD17\n\nclass Solution {\npublic:\n
\n# Complexity\n```\n- Time complexity:\nO(nlogn)\n\n- Space complexity:\nO(1)\n```\n\n# Code\n## Please Upvote if it helps\uD83E\uDD17\n```\nclass Solution {\npublic:\n    int minRectanglesToCoverPoints(vector<vector<int>>& points, int w) {\n        int n = points.size(), ans = 0, cover = -1;\n        sort(points.begin(), points.end());\n        for(int i = 0 ; i < n ; i++){\n            int x = points[i][0];\n            if(x > cover){\n                ans++;\n                cover = x + w;\n            }\n        }\n        return ans;\n    }\n};\n```
['Greedy', 'Sorting', 'C++']