You are viewing a single comment's thread. Return to all comments →
C++ solution :
int makingAnagrams(string s1, string s2) { map<char, int> m1, m2; int deletions=0; for (char ch:s1) m1[ch]++; for (char ch:s2) m2[ch]++; for (int i=0;i<26;i++) deletions+=abs(m1['a'+i]-m2['a'+i]); return deletions; }
Seems like cookies are disabled on this browser, please enable them to open this website
Making Anagrams
You are viewing a single comment's thread. Return to all comments →
C++ solution :