I was going through some old documents the other day and found some instructions for a one way cipher:
Given a word w, iterate over its characters. For each character c, determine if its zero based index in the alphabet is odd or even. Once determined, perform one of the following actions:
- Even: Add one.
- Odd: Subtract two.
Replace the character c with this newly determined index. For example:
input = test output = rftr
To confirm your results, performing the algorithm on the word azalea should yield the following output:
However, when I attempted to recreate the results, my answer was incorrect. Upon closer inspection, it appears there was a sentence between character replacement example and the confirmation, but it's so faded that I can't make it out.
Can you help me find the missing step?