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.