Vigenère encode

Write codeMedium16 min

Your task

A puzzle channel encodes lowercase messages with a repeating keyword. The i-th letter of the message (counting only letters) is shifted forward by the alphabet index of the i-th keyword letter ('a' shifts by 0, 'b' by 1, ...), with the keyword repeating from its start when it runs out. Spaces are kept as-is and do not consume a keyword letter. The keyword is non-empty lowercase. For example, encoding 'hello' with key 'ab' gives 'hflmo'.

Examples

keyword_encode(message: str, key: str) -> str
Example 1
Inputkeyword_encode("hello", "ab")
Output"hflmo"