Ez O(n) and O(nlogn) solutions beats 100%
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>>& points, int w) {\n        \n        //O(n) solution\n        set<int> st;\n        int first=INT_MAX;\n        for(vector<int>& i: points) {st.insert(i[0]); first=min(first,i[0]);}\n        int r=first+w, cnt=1;\n        for(auto& i: st){\n            if(r<i){\n                r=i+w,cnt++;\n            }\n        } \n        return cnt;\n\n\n        //nlogn solution\n        // sort(points.begin(),points.end());\n        // vector<int> f=points[0];\n        // int r=f[0]+w,cnt=1;\n        // for(vector<int>& i: points){\n        //     if(r<i[0]){\n        //         cnt++;\n        //         r=l+w;\n        //     }\n        // }\n        // return cnt;\n    }\n};\n```
['C++']