Maximum count of equal numbers in an array after performing given operations | Function to find the maximum number of equal numbers in an array ; to store sum of elements ; if sum of numbers is not divisible by n ; Driver Code ; size of an array
def EqualNumbers ( a , n ) : NEW_LINE INDENT sum = 0 ; NEW_LINE for i in range ( n ) : NEW_LINE INDENT sum += a [ i ] ; NEW_LINE DEDENT if ( sum % n ) : NEW_LINE INDENT return n - 1 ; NEW_LINE DEDENT return n ; NEW_LINE DEDENT a = [ 1 , 4 , 1 ] ; NEW_LINE n = len ( a ) ; NEW_LINE print ( EqualNumbers ( a , n ) ) ; NEW_LINE