
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
When a character is replaced by the one that comes before it on the alphabet, it makes the string lexicographically smaller, except for ‘a'.
Find the leftmost substring that doesn’t contain the character 'a' and change all characters in it.