param { number [ ] } numbers return { boolean } function IsContinuous ( numbers ) { if ( numbers === null || numbers . length < 1 ) { return false ; } numbers = numbers . sort ( ( a , b ) => ( a - b ) ) ; let len = numbers . length ; let numberOfZero = 0 ; let numberOfGap = 0 ; for ( let i = 0 ; i < len && numbers [ i ] === 0 ; i ++ ) { numberOfZero ++ ; } let small = numberOfZero ; let big = small + 1 ; while ( big < len ) { if ( numbers [ small ] === numbers [ big ] ) { return false ; } numberOfGap += numbers [ big ] - numbers [ small ] - 1 ; small = big ; big ++ ; } return numberOfGap > numberOfZero ? false : true ; } export { IsContinuous } ;