docs: function newRangeCount(
    prev: {first: number, last: number},
    next: {first: number, last: number},
  ): number {
    return (
      next.last -
      next.first +
      1 -
      Math.max(
        0,
        1 + Math.min(next.last, prev.last) - Math.max(next.first, prev.first),
      )
    );
  }