Decode the Message LeetCode solution in Python
1class Solution:2def decodeMessage(self, key: str, message: str) -> str:3mapping = {" ": " "}4i = 05res = ""6letters = "abcdefghijklmnopqrstuvwxyz"78for char in key:9if char not in mapping:10mapping[char] = letters[i]11i += 11213for char in message:14res += mapping[char]1516return res