JS | O(NlogN)
Code\njavascript []\n/**\n * @param {number[][]} points\n * @param {number} w\n * @return {number}\n */\nvar minRectanglesToCoverPoints = function(points, w) {\
# Code\n```javascript []\n/**\n * @param {number[][]} points\n * @param {number} w\n * @return {number}\n */\nvar minRectanglesToCoverPoints = function(points, w) {\n    points.sort((a, b) => a[0] - b[0]);\n    let last = -Infinity, res = 0;\n    for(let [x, y] of points) {\n        if(x > last) {\n            res++;\n            last = x + w;\n        }\n    }\n\n    return res;\n};\n```
['JavaScript']