2D Array : simple  solution by sorting.
Intuition\nArray sort simple solution.\n\n\n\n# Code\n\nimport java.util.Arrays;\n\nclass Solution {\n    public int minRectanglesToCoverPoints(int[][] points, 
# Intuition\nArray sort simple solution.\n\n\n\n# Code\n```\nimport java.util.Arrays;\n\nclass Solution {\n    public int minRectanglesToCoverPoints(int[][] points, int w) {\n        Arrays.sort(points, (a, b) -> a[0] - b[0]);\n        \n        int rectangleCount = 0;\n        int currentEnd = Integer.MIN_VALUE;\n        \n        for (int[] point : points) {\n            int x = point[0];\n            int y = point[1];\n            \n           \n            if (x > currentEnd) {\n                \n                rectangleCount++;\n            \n                currentEnd = x + w;\n            }\n        }\n        \n        return rectangleCount;\n    }\n\n}\n \n```
['Java']