class Solution(object):
def uniqueMorseRepresentations(self, words):
"""
:type words: List[str]
:rtype: int
"""
d = dict(zip("abcdefghijklmnopqrstuvwxyz",
[".-","-...","-.-.","-..",".","..-.","--.",
"....","..",".---","-.-",".-..","--","-.",
"---",".--.","--.-",".-.","...","-",
"..-","...-",".--","-..-","-.--","--.."]))
seen = set([])
for word in words:
t = ""
for c in word:
t += d[c]
seen.add(t)
return len(seen)