funcisAnagram(s string, t string)bool { iflen(s) != len(t) { returnfalse } chm := make(map[byte]int, 26) for i, _ := range s { if _, ok := chm[s[i]]; ok { chm[s[i]] += 1 } else { chm[s[i]] = 1 } } for i, _ := range t { if _, ok := chm[t[i]]; ok { chm[t[i]] -= 1 } else { returnfalse } } for _, v := range chm { if v != 0 { returnfalse } } returntrue }