Pages

Tuesday, June 28, 2016

Coding challenge : Equidistant letter sequence

So, you're a very low tech spy and you want to encrypt a message before sending it.

You want to insert a certain number of random letters and place them between each letter in your message.  For example,

hello

would become

hwoexolehlzhowe

After each letter in the message, two random letters are inserted.

Your mission, should you choose to accept it, is to create this Equidistant encoder, and also an Equidistant decoder which will return the encoded message back to its original code.

Your function should accept two parameters.  1, the message to be encoded, and 2, a number.  This number argument determines how many random letters are place between each letter.

Good luck,

Solution is in the comments.


No comments:

Post a Comment