key_phrase that contains every lowercase English letter at least once (it may contain spaces as well).
The substitution table is built like this: list the letters of the key in the order of their **first** appearance, skipping spaces and repeats. That gives 26 distinct letters. The first one decodes to a, the second to b, and so on up to z.
Decode the note text: replace each letter using the table and leave spaces where they are. Return the resulting string.key_phrase='pack my box with five dozen liquor jugs', text='hmml pl fvvf' → 'meet at noon'
The key letters in order of first appearance are p a c k m y b o x w i t h f v e d z n l q u r j g s, so p→a, a→b, c→c, k→d, m→e, …, h→m, f→n, v→o, l→t. The note reads "meet at noon".
key_phrase='zyxwvutsrqponmlkjihgfedcba', text='svool dliow' → 'hello world'
The key is the alphabet reversed, so every letter maps to its mirror; spaces stay as they are, double ones included.
key_phrase and text consist of lowercase English letters and spaceskey_phrase contains every letter from a to zkey_phrase='pack my box with five dozen liquor jugs', text='hmml pl fvvf'
'meet at noon'
Run checks the first 3 tests in your browser. Submit checks all 199 tests on the server, hidden ones included.