human
Maximum number of 0 s placed consecutively at the start and end in any rotation of a Binary String | Function to find the maximum sum of consecutive 0 s present at the start and end of a string present in any of the rotations of the given string.
Check if all the characters in the string are 0.
Iterate over characters of the string.
If the frequency of '1' is 0.
Print n as the result.
Concatenate the string with itself.
Stores the required result.
Generate all rotations of the string.
Store the number of consecutive 0 s at the start and end of the string.
Count 0 s present at the start.
Count 0 s present at the end.
Calculate the sum.
Update the overall maximum sum.
Print the result.
Driver Code.
Given string.
Store the size of the string"
How can the above be solved in Python?

Write me a code to maximum number of 0 s placed consecutively at the start and end in any rotation of a Binary String and the other steps required?
assistant
#Here is code to maximum number of 0 s placed consecutively at the start and end in any rotation of a Binary String and the other steps required.
 def findMaximumZeros ( st , n ) :
	c0 = 0
	for i in range ( n ) :
		if ( st [ i ] == '0' ) :
			c0 += 1
	if ( c0 == n ) :
		print ( n )
		return
	s = st + st
	mx = 0
	for i in range ( n ) :
		cs = 0
		ce = 0
		for j in range ( i , i + n ) :
			if ( s [ j ] == '0' ) :
				cs += 1
			else :
				break
		for j in range ( i + n - 1 , i - 1 , - 1 ) :
			if ( s [ j ] == '0' ) :
				ce += 1
			else :
				break
		val = cs + ce
		mx = max ( val , mx )
	print ( mx )
if __name__ == " _ _ main _ _ " :
	s = "1001"
	n = len ( s )
	findMaximumZeros ( s , n )