input: Write a python function that calculates the minimum number of rectangles required to cover all given points in a 2D plane. The points are given as a list of lists with each sublist representing coordinates `[x_i, y_i]`. You are also given an integer `w`, which specifies the maximum width allowed for each rectangle, i.e., the difference between the x-coordinates of the rectangle's left and right edges must not exceed `w`. Each rectangle extends from one point at `(x_1, 0)` to `(x_2, y_2)` where `x_1 <= x_2, y_2 >= 0`. The goal is to ensure that each point is covered by at least one rectangle, and a point is considered covered if it is on the boundary or inside the rectangle. The function should return the minimum number of such rectangles.
  
  Examples:
  >>> points = [[2,1],[1,0],[1,4],[1,8],[3,5],[4,6]], w = 1
  2
  >>> points = [[0,0],[1,1],[2,2],[3,3],[4,4],[5,5],[6,6]], w = 2
  3
  >>> points = [[2,3],[1,2]], w = 0
  2
output: def min_rectangles(points, w):
      points.sort()
      rectangles = 0
      i = 0
      while i < len(points):
          rectangles += 1
          range_start = points[i][0]
          while i < len(points) and points[i][0] - range_start <= w:
              i += 1
      return rectangles