❄Easy Java Solution❄Beats 98% of Java Users .
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```java []\nclass Solution {\n    public int minRectanglesToCoverPoints(int[][] points, int w) {\n        Arrays.sort( points , (a,b) -> a[0] - b[0] );\n        int rs = 0 ; \n        int r = -1 ; \n        for( int[] i : points ){\n            if( i[0] > r ){\n                r = i[0] + w ; \n                ++rs ; \n            }\n        }\n        return rs ; \n    }\n}\n```
['Java']