package kata
import "strings"
func DecodeMorse(morseCode string) string {
messageEncrypt := strings.ReplaceAll(morseCode, " ", " * ")
messageEncryptSlice := strings.Split(messageEncrypt, " ")
messageDecrypt := ""
for _, val := range messageEncryptSlice {
if val == "*" {
messageDecrypt += " "
} else {
messageDecrypt += MORSE_CODE[val]
}
}
return strings.TrimSpace(messageDecrypt)
}