Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def uniqueMorseRepresentations(self, words: List[str]) -> int:
- morse = [".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."]
- 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