Count minimum removals to obtain strings of the form "00000 . . . . " or "11111 . . . "
int ans = Math . Min ( total_zeros , total_ones ) ; int cur_zeros = 0 , cur_ones = 0 ; for ( int i = 0 ; i < str . Length ; i ++ ) {