#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; }
#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; }