wSize);
    for (const task of tasks) {
      endpoints.push(task.start - windowSize);
      endpoints.push(task.start);
      endpoints.push(task.end - windowSize);
      endpoints.push(task.end);
    }
    endpoints = endpoints.filter(
        x => (startTime <= x && x + windowSize <= endTime));
    endpoints.sort((a, b) => a - b);

    // Slide the window and compute maxEQT.
    const slidingWindow = new SlidingWindow(
        endpoints[0], windowSize, sortedTasks);
    let maxEQT = 0;
    for (const t o