Atbash cipher program

Iqram Ali
2 min readOct 31, 2020

Question: You are given a lowercase alphabet string text. Return a new string where every character in text is mapped to its reverse in the alphabet, so that a becomes z, b becomes y, c becomes x, and so on.

Example 1

Input

text = "abcdef"

Output

"zyxwvu"

Algorithm

Find a new string where every character in text is mapped to its reverse in the alphabet. As an example, a becomes z, b becomes y and so on.

--

--

Iqram Ali

Developer influencer, 15+ years in software development currently in engineering leadership role.