Self Permutation Time : Space : 12345678int Solution::permuteStrings(string A, string B) { if(A.length() != B.length()) return 0; unordered_map<char, int> freq; for(auto a : A) freq[a]++; for(auto b : B) if(--freq[b] == 0) freq.erase(b); return freq.empty();}