https://leetcode.com/problems/decode-the-message


Success


```python
import string

class Solution:
    def decodeMessage(self, key: str, message: str) -> str:
        new_key = key[::-1].replace(" ", "")
        for char in new_key:
            if new_key.count(char) >= 2:
                new_key = new_key.replace(char, "", 1)
        key = new_key[::-1]

        key_length = min(26, len(key))
        alphabet_list = string.ascii_lowercase[:key_length]

        new_message = ""
        for char in message:
            if char == " ":
                new_message += " "
                continue
            index = key.find(char)
            new_char = alphabet_list[index]
            new_message += new_char
        
        return new_message
```


> Everyone could create a 'new language'.
