Driver code
int main ( ) { int binary [ ] = { 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 } ; int n = sizeof ( binary ) / sizeof ( binary [ 0 ] ) ; pair < int , int > left [ n ] ; preCalculate ( binary , n , left ) ;