human
Write me a code to deletions of "01" or "10" in binary string to make it free from "01" or "10" and the other steps required given the following:
Deletions of "01" or "10" in binary string to make it free from "01" or "10" | Function to return the count of deletions of sub - strings "01" or "10".
To store the count of 0 s and 1 s.
Driver code"
Solution in Python:
assistant
#Here is code to deletions of "01" or "10" in binary string to make it free from "01" or "10" and the other steps required.
 def substrDeletion ( string , length ) :
	count0 = 0 ;
	count1 = 0 ;
	for i in range ( length ) :
		if ( string [ i ] == '0' ) :
			count0 += 1 ;
		else :
			count1 += 1 ;
	return min ( count0 , count1 ) ;
if __name__ == " _ _ main _ _ " :
	string = "010" ;
	length = len ( string ) ;
	print ( substrDeletion ( string , length ) ) ;