← 返回 amazon 的题目列表Decode Morse Code
类型:online_judge
Given a string in Morse code, write a function to decode it into human-readable English text. The Morse code string contains only '.', '-', and spaces. Words are separated by a single space, and letters by two spaces. Consider invalid input, such as characters not in Morse code. Output should be the decoded English text. The function signature is: def decode_morse(morse_code: str) -> str.
Example
Input
.- -... -.-.