Simple approach || Just sort and skipping
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nstep1 : remove duplicates\nstep2 : sort(array)\nstep3 : from curval to cu
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nstep1 : remove duplicates\nstep2 : sort(array)\nstep3 : from curval to curval+W to next curval skip the idx\n\n# Complexity\n- Time complexity:\nO(n*log(n))+O(n) for sort + skipping\n\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution:\n    def minRectanglesToCoverPoints(self, points: List[List[int]], w: int) -> int:\n        pp=set()\n        \n        for a,b in points:\n            pp.add(a)\n        if w==0:\n            return len(pp)\n        nums=list(pp)\n        nums.sort()\n        ans=0\n        i=0\n        \n        while i<len(nums):\n            ans+=1\n            tmp=nums[i]+w\n            # print(i,tmp)\n            while i<len(nums) and nums[i]<=tmp:\n                # print(i)\n                i+=1\n        return ans\n            \n            \n```
['Greedy', 'Sorting', 'Python3']