Anagram Together-FAANG

void groupanagram(vector v,int n)
{
map<map<char,int>,vector> hashmap;

for(int i=0;i<n;i++)
{
map<char,int> temp;
string s = v[i];
for(int j=0;j<s.length();j++)
{
temp[s[j]]++;
}
hashmap[temp].push_back(v[i]);
}

for(auto it= hashmap.begin();it!=hashmap.end();it++)
{
    for(auto x: it->second)
    {
        cout<<x<<" ";
    }
    cout<<endl;
}

return;

}