index.js
function upperBound(value, arr) {
    let i = 0;
    let j = arr.length - 1;
    while (i < j) {
        const m = (i + j) >> 1;
        if (arr[m] > value) {
            j = m;
        } else {
            i = m + 1;
        }
    }
    return arr[i];
}
function upperBound(value, arr) {
    let i = 0;
    let j = arr.length - 1;
    while (i < j) {
        const m = (i + j) >> 1;
        if (arr[m] > value) {
            j = m;
        } else {
            i = m + 1;
        }
    }
    return arr[i];
}
function upperBound ( value , arr ) { let i = 0 ; let j = arr . length - 1 ; while ( i < j ) { const m = ( i + j ) >> 1 ; if ( arr [ m ] > value ) { j = m ; } else { i = m + 1 ; } } return arr [ i ] ; }
binary search for the first value in the array bigger than the given
binary search for the first value in the array bigger than the given