Function to return the minimum number of characters of the given binary string to be replaced to make the string alternating
def minReplacement ( s , length ) : NEW_LINE INDENT ans = 0 NEW_LINE for i in range ( 0 , length ) : NEW_LINE DEDENT