class Solution:
    def uniqueMorseRepresentations(self, words):
        lib = [".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---",
               ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."]
        return len({''.join(lib[ord(c) - ord('a')] for c in word) for word in words})

 

相关文章:

  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2021-07-10
  • 2022-12-23
  • 2022-02-19
  • 2021-06-24
猜你喜欢
  • 2022-03-01
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-23
  • 2022-12-23
相关资源
相似解决方案