count the frequency of every element
for i in range ( n ) : NEW_LINE INDENT if a [ i ] not in Hash : NEW_LINE INDENT Hash [ a [ i ] ] = 1 NEW_LINE DEDENT else : NEW_LINE INDENT Hash [ a [ i ] ] += 1 NEW_LINE DEDENT DEDENT