#C6801. Lexicographically Maximal String Transformation
Lexicographically Maximal String Transformation
Lexicographically Maximal String Transformation
Given a string s
consisting of lowercase English letters, your task is to transform it into the lexicographically maximal string possible by applying a specific type of operation any number of times. In each operation, you can choose any character in the string and increment it by one (i.e. change it to the next character in the alphabet). You can repeat this operation until the chosen character becomes z
. Since every character can eventually become z
, the lexicographically maximal string that can be achieved is simply a string of the same length as s
with every character replaced by z
.
In mathematical terms, if the original string s
has length n, then the output string is given by:
where z^n
denotes the character z
repeated n times.
inputFormat
The input consists of a single line which contains the string s
. The string is guaranteed to consist only of lowercase English letters.
outputFormat
Output a single line containing the lexicographically maximal string obtained by replacing every character of the input with z
.
abc
zzz