Java O(NlogN) Solution
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 {\n    public int minRectanglesToCoverPoints(int[][] points, int w) {\n        Arrays.sort(points, (a, b) -> Integer.compare(a[0],b[0]));\n        int i=points[0][0],j=points[points.length-1][0],min=i,ans=1;\n        for(int k=0;k<points.length;k++){\n            if(points[k][0]<=min+w){\n                continue;\n            }\n            ans++;\n            min=points[k][0];\n        }\n        \n        return ans;\n    }\n}\n```
['Java']