If operator next to current operand is XOR ( Assuming a valid input )
else : NEW_LINE INDENT if ( s [ i + 2 ] == s [ i ] ) : NEW_LINE INDENT s [ i + 2 ] = "0" NEW_LINE DEDENT else : NEW_LINE INDENT s [ i + 2 ] = "1" NEW_LINE DEDENT DEDENT return ord ( s [ n - 1 ] ) - ord ( "0" ) NEW_LINE