Advertisement
yuntai

Untitled

May 19th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. class Solution:
  2.     def uniqueMorseRepresentations(self, words: List[str]) -> int:
  3.         morse = [".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."]
  4.         return len({"".join(map(lambda c: morse[ord(c)-ord('a')], w)) for w in words})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement