codeathon – Let’s code and win

codeathon – Let’s code and win

Write an algorithm that analyzes and decodes a string.

The cipher works as follows: it takes the alphabet and a keyword (that shall not include duplicate letters) and builds a new string starting with the keyword and continues with the letters of the unused alphabet.

Example (the keyword in the example is KEYWORD):

Input:
– “KEYWORD” as the keyword
– String that has to be deciphered.
Output: String representing the decoded word.

Example:

For: KEYWORD and code: LXQAJI

L – P
X – Y
Q – T
A – H
J – O
I – N

Output is PYTHON.

 

Btw, I was the winner, my solution beat 1340 other solutions to become the fastest 🙂

Follow Me