storing the number of occurrence of elements in unordered map
for ( int i = 0 ; i < n ; i ++ ) { if ( m . find ( v [ i ] ) == m . end ( ) ) m [ v [ i ] ] = 1 ; else m [ v [ i ] ] ++ ; } int count = 0 ;