stores number of zeroes and ones at even positions
one_even = 0 NEW_LINE zero_even = 0 NEW_LINE for i in range ( N ) : NEW_LINE INDENT if ( i % 2 == 0 ) : NEW_LINE INDENT if ( s [ i ] == '1' ) : NEW_LINE INDENT one_even += 1 NEW_LINE DEDENT else : NEW_LINE INDENT zero_even += 1 NEW_LINE DEDENT DEDENT DEDENT if ( one > zero ) : NEW_LINE INDENT return num - one_even NEW_LINE DEDENT else : NEW_LINE INDENT return num - zero_even NEW_LINE DEDENT