Menu

[solved] – Question 76526

Write a function num_dups that takes in a string and returns the number of duplicated characters in the string.

Hint: You can use a std::map to maintain a count of the characters.

#include <string>

using namespace std;

int num_dups(string str) {
//code

}

Expert Answer


OR


Leave a Reply

Your email address will not be published. Required fields are marked *