# [Leet Code] Unique Morse Code Words

`[".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."]`
`Example:Input: words = ["gin", "zen", "gig", "msg"]Output: 2Explanation: The transformation of each word is:"gin" -> "--...-.""zen" -> "--...-.""gig" -> "--...--.""msg" -> "--...--."There are 2 different transformations, "--...-." and "--...--.".`
`class Solution(object):    def uniqueMorseRepresentations(self, words):        """        :type words: List[str]        :rtype: int        """        alphabet = [".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."]        answer = {}        for i in words:            string = ""            for j in i:                string = string + alphabet[ord(j) - 97]            answer[string] = 1         return len(answer)`

--

--

--

Learning, and posting my findings!

Love podcasts or audiobooks? Learn on the go with our new app.

## Matthew Boyd

Learning, and posting my findings!