Java beginner friendly intuition !!
Intuition\n  We know that we don\'t need to worry about height of the rectangle i.e:y coordinate i.e 1st index, because there is the boundation about width only
# Intuition\n  We know that we don\'t need to worry about height of the rectangle i.e:y coordinate i.e 1st index, because there is the boundation about width only not the height.\n\nSo let\'s take the input :\n0,1,2,3,4,5,6       width = 2\nso from 0 -> 2      we can form 1 rectangle\nthen from 3 -> 5    we can form 1 rectangle\nand from 6          we can form 1 rectangle\n\nIt means we simply need to keep the track of width which could be the current_value + width , right?\n\nSo, this is how you are going to solve this problem, just dry run the code and you will get cleared with this concept as well.\n\n# Approach\n  Greedy\n\n\n# Code\n```\nclass Solution {\n    public int minRectanglesToCoverPoints(int[][] points, int w) {\n        int n = points.length;\n        Arrays.sort(points, (a,b) -> a[0]-b[0]);\n        int ans = 0;\n        for(int i=0;i<n;){\n            int currentValue = points[i][0];\n            int maxValue = points[i][0]+w;\n            ans++;\n            while(i<n && points[i][0]<=maxValue) i++;\n        }\n        return ans;\n    }\n}\n```
['Array', 'Greedy', 'Java']