Golang 17 lines of easy to understand solution without using sort
We can take advantage of anagram\'s defination:\n> An anagram is a word or phrase formed by rearranging the letters of a different word or phrase\n\nSo we can c
We can take advantage of anagram\'s defination:\n> An anagram is a word or phrase formed by rearranging the letters of a different word or phrase\n\nSo we can consider using a hashmap to store every letter\'s frequency and group those who have the same frequency, but in Golang slice cannot be a key. \nWe are told:\n> All inputs will be in lowercase.\nSo we can use array as a key, whose capacity is 26 since there are only 26 letters. \n\n* time complexity: O(nk), n is `len(strs)`, k is the length of the longest string in `strs`\n* space complexity: O(nk), for we are using a hashmap\n\n```\nfunc groupAnagrams(strs []string) [][]string {\n\tmp := map[[26]int][]string{}\n\tfor _, s := range strs {\n\t\tk := [26]int{}\n\t\tfor i := 0; i < len(s); i++ {\n\t\t\tk[s[i]-\'a\'] += 1\n\t\t}\n\t\tmp[k] = append(mp[k], s)\n\t}\n\tres := [][]string{}\n\tfor _, v := range mp {\n\t\tres = append(res, v)\n\t}\n\treturn res\n}\n```
['Go']