human
Maximum number of splits of a binary number | Function to return the required count.
If the splitting is not possible.
To store the count of zeroes.
Counting the number of zeroes.
Return the final answer.
Driver code"
Solution in Python:
 Write me a code to maximum number of splits of a binary number and the other steps required?
assistant
#Here is code to maximum number of splits of a binary number and the other steps required.
 def cntSplits ( s ) :
	if ( s [ len ( s ) - 1 ] == '1' ) :
		return - 1 ;
	ans = 0 ;
	for i in range ( len ( s ) ) :
		ans += ( s [ i ] == '0' ) ;
	return ans ;
if __name__ == " _ _ main _ _ " :
	s = "10010" ;
	print ( cntSplits ( s ) ) ;