Logo
IconChallenge
Icon
IconProblem
IconSolutions
IconSubmissions

Unique Morse Code Words

XPChallenge Points: 10
levelLevel: Easy

In International Morse Code, each English letter is represented by a sequence of dots (.) and dashes (-).
For example:
• 'a' → ".-"
• 'b' → "-..."
• 'c' → "-.-."
and so on.
You are given an array of lowercase English words, words.
Each word can be converted to Morse code by concatenating the Morse representation of each letter.
Your task is to return the number of unique Morse code transformations among all given words.

Example 1:

Input: words = ["dog", "dig", "cat", "cot"]

Output: 4

Example 2:

Input: words = ["moon", "soon", "noon"]

Output: 3

to Continue
like
dislike

Accepted:

Submission:

IconReport an issue
Icon
IconCode
IconYou need toto run or submitYou need toto run or submit
IconTest Case
IconTest Result