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.
Input: words = ["dog", "dig", "cat", "cot"]
Output: 4
Input: words = ["moon", "soon", "noon"]
Output: 3
Accepted:
Submission: