Two Pointers
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```csharp []
public class Solution {
    public string SmallestString(string s) {
        // case 1 : Find the first ch which is different with 'a', then find the not contains 'a' region: -1 for all of the chars in this region
        int start = 0, end = 0, len = s.Length;
        while(start < len && s[start] == 'a')
        {
            start++;
        }

        if(start == len)  // if cannot find valid region in case 1, last char change to 'z'
            return s.Substring(0, len-1) + "z";

        end = start+1;
        while(end < len && s[end] != 'a')
        {
            end++;
        }

        StringBuilder res = new StringBuilder(s);
        for(int i = start; i < end; i++)
        {
            res[i]--;
        }

        return res.ToString();
    }
}
```
['C#']