Easy Solution using Set and sum
\n\n# Code\n\nclass Solution {\npublic:\n    int minRectanglesToCoverPoints(vector<vector<int>>& v, int w) {\n        int n=v.size();\n        set<int>s;\n     
\n\n# Code\n```\nclass Solution {\npublic:\n    int minRectanglesToCoverPoints(vector<vector<int>>& v, int w) {\n        int n=v.size();\n        set<int>s;\n        for(auto i:v) {\n            s.insert(i[0]);\n        }\n        vector<int>t;\n        for(auto i:s)\n            t.push_back(i);\n        int ans=1;\n        int k=t[0]+w;\n        int i=1;\n        int m=t.size();\n        while(i<m) {\n            while(i<m && t[i]<=k)\n                i++;\n            if(i<m) {\n                ans++;\n                k=t[i]+w;\n                i++;\n            }\n        }\n        return ans;\n    }\n};\n```
['Ordered Set', 'C++']