Loop to find the subString whose decimal equivalent is greater than or equal to K
while ( l >= 0 && ( r - l + 1 ) <= 64 && ( int ) ( Convert . ToInt32 ( s . Substring ( l , r + 1 - l ) , 2 ) ) < k ) { l -- ; }