Assumptions : vector a is sorted , max - difference of two adjacent elements is 1
function sequence ( a ) { if ( a . length == 0 ) return [ 0 , 0 ] let s = 0 let e = a . length - 1 while ( s < e ) { let m = Math . floor ( ( s + e ) / 2 ) ;