React.js
Angular
Ethical Hacking
Agile
AWS
BlockChain
Cassandra
Cloud
Salesforce
Scaled Agile
TOGAF
DevOps
GIT
Jenkins
Jira
Kibana
Linux
NGINX
Ansible
Artificial Intelligence
in C++ by

How to find duplicates in a vector ?

Click here to read more about DevOps

1 Answer

0 votes
by
  • 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.

Related questions

Madanswer
+1 vote
asked Jul 16, 2019 in C++ by Indian
+1 vote
asked Jul 16, 2019 in C++ by Indian
+1 vote
asked Jul 16, 2019 in C++ by Indian
+1 vote
asked Jul 16, 2019 in C++ by Indian
+1 vote
asked Jul 16, 2019 in C++ by Indian
...