Iterate for each index of bit [ ] array from 31 to 0 , and check if the ith value of bit array is 0
for ( int i = 31 ; i >= 0 ; i -- ) { if ( bit [ i ] == 0 && k > 0 ) { int temp = build_num ( bit ) ; int temp1 = temp ; int val = -1 ; for ( int j = 0 ; j < n ; j ++ ) {