Beats 100% | Easy Java Solution
\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        int 
\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        int ans = 0;\n        for(int i=0;i<points.length;i++){\n            int j=i+1;\n           \n            for( j=i+1;j<points.length;j++){\n                if(points[j][0]-points[i][0]<=w)    continue;\n                else break;\n            }\n            ans++;\n            i=j-1;\n        }\n        return ans;\n        \n    }\n}\n```
['C', 'Python', 'C++', 'Java', 'Go', 'Python3', 'Rust', 'Ruby', 'JavaScript', 'C#']