in C Plus Plus by

How to find duplicates in a vector ?

▼ Show 1 Answer

0 votes
  • 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.
Learn More with Madanswer

Related questions

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