eraseOverlapIntervals = function (intervals) {
    intervals.sort(([aStart, aEnd], [bStart, bEnd]) =>
        aEnd !== bEnd ? aEnd - bEnd : aStart - bStart
    );

    return getGaps(intervals);
}
https://leetcode.com/problems/non-overlapping-intervals/
Time O(N * logN) | Space O(1)
@param {number[][]} intervals
@return {number}