human
Check for Majority Element in a sorted array | .
Driver code"
Solution in Python:
 Write me a code to check for Majority Element in a sorted array and the other steps required?
assistant
#Here is code to check for Majority Element in a sorted array and the other steps required.
 def isMajorityElement ( arr , n , key ) :
	if ( arr [ n // 2 ] == key ) :
		return True
	return False
if __name__ == " _ _ main _ _ " :
	arr = [ 1 , 2 , 3 , 3 , 3 , 3 , 10 ]
	n = len ( arr )
	x = 3
	if ( isMajorityElement ( arr , n , x ) ) :
		print ( x , " ▁ appears ▁ more ▁ than ▁ " , n // 2 , " ▁ times ▁ in ▁ arr [ ] " )
	else :
		print ( x , " ▁ does ▁ not ▁ appear ▁ more ▁ than " , n // 2 , " ▁ times ▁ in ▁ arr [ ] " )