Java solution - care only about X. 
IntuitionEven though the problem asks for "rectangles", we don't really care about the y axis at all here.
It's more like grouping X's into a range of w;Approac
# Intuition
Even though the problem asks for "rectangles", we don't really care about the y axis at all here. 
It's more like grouping X's into a range of w; 

# Approach
Let's just sort the Xs- 

For the first time reachable range is -1 (nothing's reachable)

If current point is unreachable
- create a new rectangle - mark reachable as current x + w
- and add a rectangle to our count

Otherwise we can just skip

# Complexity
- Time complexity:
O(n log n) for the sort - and then O(n) for the computation itself 
We can just say n log n as the n happens after; 

- Space complexity:
The sorting algo usually uses n space ig

# Code
```java []
class Solution {
    public int minRectanglesToCoverPoints(int[][] points, int w) {
        //Problem says rectangles but all we care about is the x points - it'll be interesting to see a follow up where y gets involved too. 
        Arrays.sort(points, (a,b)-> Integer.compare(a[0], b[0]));

        int currentRects =0 ; 
        int currentRange = -1; 

        for(int point[]: points){
            if(currentRange < point[0]){
                currentRects++; 
                currentRange = point[0] + w;
            }//We don't can just skip the else part we do nothing, rectangle is already there. 
        }
        return currentRects; 
        
    }
}
```
['Java']