human
Maximum number of consecutive 1 's in binary representation of all the array elements | Function to return the count of maximum consecutive 1 s in the binary representation of x.
Initialize result.
Count the number of iterations to reach x = 0..
This operation reduces length of every sequence of 1 s by one.
Function to return the count of maximum consecutive 1 s in the binary representation among all the elements of arr [ ].
To store the answer.
For every element of the array.
Count of maximum consecutive 1 s in the binary representation of the current element.
Update the maximum count so far.
Driver code"
Solution in Python:

Give me a code to maximum number of consecutive 1 's in binary representation of all the array elements and the other steps required?
assistant
#Here is code to maximum number of consecutive 1 's in binary representation of all the array elements and the other steps required.
 def maxConsecutiveOnes ( x ) :
	count = 0 ;
	while ( x != 0 ) :
		x = ( x & ( x << 1 ) ) ;
		count += 1 ;
	return count ;
def maxOnes ( arr , n ) :
	ans = 0 ;
	for i in range ( n ) :
		currMax = maxConsecutiveOnes ( arr [ i ] ) ;
		ans = max ( ans , currMax ) ;
	return ans ;
if __name__ == " _ _ main _ _ " :
	arr = [ 1 , 2 , 3 , 4 ] ;
	n = len ( arr ) ;
	print ( maxOnes ( arr , n ) ) ;