human
Check if all the 1 's in a binary string are equidistant or not | Function that returns true if all the 1 's in the binary s are equidistant.
Initialize vector to store the position of 1 's.
Store the positions of 1 's.
Size of the position vector.
If condition isn 't satisfied.
Driver code"
Solution in Python:
assistant
#Here is code to check if all the 1 's in a binary string are equidistant or not and the other steps required.
 def check ( s , l ) :
	pos = [ ]
	for i in range ( l ) :
		if ( s [ i ] == '1' ) :
			pos . append ( i )
	t = len ( pos )
	for i in range ( 1 , t ) :
		if ( ( pos [ i ] - pos [ i - 1 ] ) != ( pos [ 1 ] - pos [ 0 ] ) ) :
			return False
	return True
s = "100010001000"
l = len ( s )
if ( check ( s , l ) ) :
	print ( " Yes " )
else :
	print ( " No " )