Simple Java Solution
Code\n\nclass Solution {\n    public int minRectanglesToCoverPoints(int[][] points, int w) {\n        TreeSet<Integer> t=new TreeSet<Integer>();\n        for(in
# Code\n```\nclass Solution {\n    public int minRectanglesToCoverPoints(int[][] points, int w) {\n        TreeSet<Integer> t=new TreeSet<Integer>();\n        for(int i=0;i<points.length;i++)\n        {\n            t.add(points[i][0]);\n        }\n        int count=0;\n        Iterator<Integer> itr=t.iterator();\n        int min=-1;\n        while(itr.hasNext())\n        {\n             if(min==-1)\n             {\n                min=itr.next();\n             }\n             else\n             {\n                int p=itr.next();\n                if(p-min>w)\n                {\n                    count++;\n                    min=p;\n                }\n             }\n        }\n\n        return count+1;\n    }\n}\n```
['Java']