4021. Minimum Operations to Make a Rotated Palindrome I
You are given a string
sconsisting of lowercase English letters.You can perform the following operations any number of times (including zero) and in any order:
- Increment: Choose any index
iand replaces[i]with the next lowercase English letter. The letter after'z'is'a'.- Left rotate: Move the first character of the string to the end.
Return the minimum number of operations required to make
sa palindrome.
1 | class Solution { |