✅99.4% beats solution in java
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)->(a[0]-b[0]));\n\n        int ans=1;\n\n        int curr=points[0][0];\n        int n=points.length;\n        for( int i=0; i<n; i++)\n        {\n            if(points[i][0]>w+curr)\n            {\n                ans++;\n                curr=points[i][0];\n            }\n        }\n        return ans;\n    }\n}\n```
['Java']