Driver code
let binary = [ 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 ] ; let n = binary . length ; let left = new Array ( n ) ; for ( let i = 0 ; i < n ; i ++ ) left [ i ] = [ 0 , 0 ] ; preCalculate ( binary , n , left ) ;