Count the frequency of arr [ i ]
count = 0 ; NEW_LINE for j in range ( N ) : NEW_LINE INDENT if ( arr [ i ] == arr [ j ] ) : NEW_LINE INDENT count += 1 ; NEW_LINE DEDENT DEDENT if ( count >= 2 ) : NEW_LINE INDENT f = 1 ; NEW_LINE break ; NEW_LINE DEDENT if ( f == 1 ) : NEW_LINE return True ; NEW_LINE else : NEW_LINE return False ; NEW_LINE