Assuming a mapping for morse code to char (and vice versa) is available, write two functions:
encode: Encodes a regular string into morse code string.decode: Returns all possible decoded message strings for a given morse code string.Hypothetical mapping and examples:
{ 'A': '.', 'B': '-', 'C': '.-'}
encode('AB') -> '.-'
encode('C') -> '.-'
decode('.-') -> ['C', 'AB']Closest conceptual LC equivalent is probably: https://leetcode.com/problems/decode-ways/