My simple solution to today's question 49. Group anagrams in LeetCode:
class Solution {
public:
string hash(string s){
string res('*',29);
for(char c:s)
res[c-97]++;
return res;
}
vector groupAnagrams(vector& strs) {
vector res;
unordered_map mp;
for(int i=0;i
class Solution {
public:
string hash(string s){
string res('*',29);
for(char c:s)
res[c-97]++;
return res;
}
vector groupAnagrams(vector& strs) {
vector res;
unordered_map mp;
for(int i=0;i