[Java / Python 3] Sort and traverse w/ brief explanation and analysis.
Sort only x-coordinates of the points;\n2. Apply greedy algorithm against x-coordiates when traversing points.\n\njava\n    public int minRectanglesToCoverPoint
1. Sort only x-coordinates of the `points`;\n2. Apply greedy algorithm against x-coordiates when traversing `points`.\n\n```java\n    public int minRectanglesToCoverPoints(int[][] points, int w) {\n        Arrays.sort(points, Comparator.comparingInt(p -> p[0]));\n        int ans = 0, rectangleRightBound = -1;\n        for (int[] point : points) {\n            if (point[0] > rectangleRightBound) {\n                rectangleRightBound = point[0] + w;\n                ++ans;\n            }\n        }\n        return ans;\n    }\n```\n```python\n    def minRectanglesToCoverPoints(self, points: List[List[int]], w: int) -> int:\n        ans, rectangle_right_bound = 0, -1\n        for x, _ in sorted(points):\n            if x > rectangle_right_bound:\n                rectangle_right_bound = x + w\n                ans += 1\n        return ans\n```\n\n**Analysis:**\n\nTime: `O(nlogn)`, space: `O(Sorting space)`, where `n = points.length`.\n\n
['Greedy', 'Java', 'Python3']