human
Minimum characters that are to be inserted such that no three consecutive characters are same | Function to return the count of characters that are to be inserted in str1 such that no three consecutive characters are same.
To store the count of operations required.
A character needs to be inserted after str1 [ i + 1 ].
Current three consecutive characters are not same.
Driver code"
Solution in Python:

Give me a code to minimum characters that are to be inserted such that no three consecutive characters are same and the other steps required?
assistant
#Here is code to minimum characters that are to be inserted such that no three consecutive characters are same and the other steps required.
 def getCount ( str1 , n ) :
	cnt = 0 ;
	i = 0 ;
	while ( i < n - 2 ) :
		if ( str1 [ i ] == str1 [ i + 1 ] and str1 [ i ] == str1 [ i + 2 ] ) :
			cnt += 1
			i = i + 2
		else :
			i += 1
	return cnt
str1 = " aabbbcc "
n = len ( str1 )
print ( getCount ( str1 , n ) )