Simple solution using sort and checking for first values
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int minRectanglesToCoverPoints(vector<vector<int>>& vec, int w) {\n           std::sort(vec.begin(), vec.end(), [](const std::vector<int>& a, const std::vector<int>& b) {\n        return a[0] < b[0];\n    });\n    int i= 0;\n    int j =1;\n    int count =0;\n    while(j<vec.size())\n    {\n        int min = vec[i][0];\n        cout<<min<<" "<<i<<j<<endl;\n        if(vec[j][0]-min>w)\n        {\n            count++;\n            i =j;\n            j++;\n        }\n        else\n        {\n            j++;\n        }\n    }\n    return count+1;\n    }\n};\n```
['C++']