Exponetnital complexity n * ( 2 ^ ( n - 1 ) ) for bit
for ( let i = 0 ; i < bt ; i ++ ) { temp = toBinary ( i ) + " " ; let j = 0 , x = n - temp . length , y ; while ( j < x ) { temp = " " + temp ; j ++ ; } j = 0 ; x = 0 ; y = - 1 ; let sp = " " , tp = " " ; let flag = 0 ; while ( j < n ) { sp += str [ j ] ; if ( temp [ j ] == ' ' ) { tp += sp + ' ' ; y = parseInt ( sp ) ;