Storing the number of occurrence of elements in unordered map
for i in range ( n ) : NEW_LINE INDENT if ( v [ i ] not in m ) : NEW_LINE INDENT m [ v [ i ] ] = 1 NEW_LINE DEDENT else : NEW_LINE INDENT m [ v [ i ] ] += 1 NEW_LINE DEDENT DEDENT count = 0 NEW_LINE