cswork / OA打开练习工作台

IBMOA #43

Get Smallest String

估计中等可在线判题

考点(AI 标注)贪心调度字符串

Choose exactly one non-empty contiguous substring and replace each letter in it with the previous letter, where a becomes z. Find the lexicographically smallest string after the operation.

输入格式

One line containing a lowercase string of length 1..100000.

输出格式

Output the smallest string after the operation.

样例 1

输入:

hackerrank

输出:

gackerrank

样例 2

输入:

bbcad

输出:

aabad

样例 3

输入:

aaa

输出:

aaz

样例说明

The examples give gackerrank, aabad and aaz respectively.