Case 2 : find the first 0 - bit index and return the Y
for ( let i = 0 ; i < len ; i ++ ) { let ch = A_binary [ len - i - 1 ] ; if ( ch == ' ' ) { B = Math . floor ( Math . pow ( 2.0 , i ) ) ; break ; } } return B ; }