Print all the duplicates in the input string

PHOTO EMBED

Thu Sep 29 2022 09:28:43 GMT+0000 (Coordinated Universal Time)

Saved by @Ranjan_kumar #c++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    string s="geeksforgeeks";
    unordered_map<char,int>mp;
    for(auto x:s)
    {
        mp[x]++;
    }
    for(auto x:mp)
    {
        cout<<x.first<<", "<<"count"<<"["<<x.second<<"]"<<"\n";
    }
    return 0;
}
content_copyCOPY

https://www.geeksforgeeks.org/print-all-the-duplicates-in-the-input-string/