2325. Decode the Message

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 2325

class Solution:
    def decodeMessage(self, key: str, message: str) -> str:
        d = {" ": " "}
        i = 0
        for c in key:
            if c not in d:
                d[c] = ascii_lowercase[i]
                i += 1
        return "".join(d[c] for c in message)