human
Count the number of clumps in the given Array | Function to count the number of clumps in the given array arr [ ].
Initialise count of clumps as 0.
Traverse the arr [ ].
Whenever a sequence of same value is encountered.
Return the count of clumps.
Driver Code.
length of the given array arr [ ].
Function Call"
How can the above be solved in Python?
 ... What is a code to count the number of clumps in the given Array and the other steps required?
assistant
#Here is code to count the number of clumps in the given Array and the other steps required.
 def countClumps ( arr , N ) :
	clumps = 0
	i = 0
	while ( i < N - 1 ) :
		flag = 0
		while ( i + 1 < N and arr [ i ] == arr [ i + 1 ] ) :
			flag = 1
			i += 1
		if ( flag ) :
			clumps += 1
		i += 1
	return clumps
arr = [ 13 , 15 , 66 , 66 , 66 , 37 , 37 , 8 , 8 , 11 , 11 ]
N = len ( arr )
print ( countClumps ( arr , N ) )