import "strings"
func uniqueMorseRepresentations(words []string) int {
hash := map[string]bool{}
translate := [...]string{".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."}
result := [12]string{}
for _, str := range words {
length := len(str)
for i := 0; i < length; i++ {
result[i] = translate[str[i]-'a']
}
hash[strings.Join(result[:length], "")] = true
}
return len(hash)
}