human
Minimum number of elements to be removed so that pairwise consecutive elements are same | Function to count the minimum number of elements to remove from a number so that pairwise two consecutive digits are same ..
initialize counting variable.
check if two consecutive digits are same.
Driver code"
Solution in Python:
assistant
#Here is code to minimum number of elements to be removed so that pairwise consecutive elements are same and the other steps required.
 def countConsecutive ( s ) :
	count = - 1
	for i in range ( len ( s ) - 1 ) :
		if ( i <= len ( s ) ) :
			if ( s [ i ] is s [ i + 1 ] ) :
				i += 1
			else :
				count += 1
	return count
if __name__ == ' _ _ main _ _ ' :
	str = "44522255"
	print ( countConsecutive ( str ) )