Sort by x, one pass, greedy count, 97% speed
image.png\n\n\n# Code\n\nclass Solution:\n    def minRectanglesToCoverPoints(self, points: List[List[int]], w: int) -> int:\n        lst_x = [x for x, _ in poin
image.png\n![image.png](https://assets.leetcode.com/users/images/96266b2c-b32d-41e3-8b0a-f94834aad976_1715047651.5601325.png)\n\n# Code\n```\nclass Solution:\n    def minRectanglesToCoverPoints(self, points: List[List[int]], w: int) -> int:\n        lst_x = [x for x, _ in points]\n        lst_x.sort()\n        count, right_end = 0, -1\n        for x in lst_x:\n            if x > right_end:\n                count += 1\n                right_end = x + w\n        return count\n```
['Python3']