Driver code
binary = [ 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 ] NEW_LINE n = len ( binary ) NEW_LINE left = [ [ 0 for i in range ( 2 ) ] for i in range ( n ) ] NEW_LINE preCalculate ( binary , n , left ) NEW_LINE