← Back to challenges

Iterative Rotation Decipher

JavaScriptHardcryptographystringslogic

Instructions

In this challenge, you have to perform reverse steps of Iterative Rotation Cipher. Decoding is done by performing a series of character and substring rotations on a string input.

Create a function that takes a string of encoded message eMessage and returns a decoded message.

Encoded Message = `10 hu fmo a,ys vi utie mr snehn rni tvte .ysushou teI fwea pmapi apfrok rei tnocsclet`

Decoded Message = `If you wish to make an apple pie from scratch, you must first invent the universe.`

See the examples below for more understanding:

Examples

iterativeDeciph("12 ory ,auruiec i,i OtacsuF!ht orpsnpo")➞ "Oh, Fortuna, you capricious sprite!"

iterativeDeciph("6 im.T ei no .lLnicsan iluushted imouys blo") ➞ "Time is an illusion. Lunchtime doubly so."

iterativeDeciph("22 tareu oo iucnaTr dled oldthser.hg hiarm nhcn se rliyet oincoa") ➞ "There is nothing more atrociously cruel than an adored child."

Notes

N/A

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.