← Back to challenges

Nico Decipher

PythonHardalgorithmscryptographylogicstrings

Instructions

In Nico Cipher, encoding is done by creating a numeric key and assigning each letter position of the message with the provided key. The detailed description of the encoding algorithm is provided by Mubashir in his challenge. You are encouraged to solve that one first.

In this challenge, the function is given the encoded message and the key. Create a reversed solution to retrieve the original message.

Examples

nico_decipher("bmusarhiahass n", "crazy") ➞ "mubashirhassan"

nico_decipher("deabtiismaaznig ", "matt") ➞ "innokodakademijaisamazing"

Notes

  • The keys consist of only letters or only digits.
  • Strip white spaces on the right of the resulting string, because they were added during the encoding.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.