3675. Minimum Operations to Transform String
You are given a string
sconsisting only of lowercase English letters.You can perform the following operation any number of times (including zero):
- Choose any character
cin the string and replace every occurrence ofcwith the next lowercase letter in the English alphabet.Return the minimum number of operations required to transform
sinto a string consisting of only'a'characters.Note:Consider the alphabet as circular, thus
'a'comes after'z'.
1 | class Solution { |