Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
How to find duplicates in a vector ?
Home
C Plus Plus
How to find duplicates in a vector ?
asked
Jul 16, 2019
in
C Plus Plus
by
Indian
How to find duplicates in a vector ?
#c
#vector
#stl
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jul 16, 2019
by
Indian
Create a map of <string , int> type to store the frequency count of each string in vector.
Iterate over all the elements in vector try to insert it in map as key with value as 1.
If string already exists in map then increment its value by 1.
...