Very simple using chr() and ord()
IntuitionSkip all the beginning 'a,' then flip characters until you find another 'a.'ApproachIterate through the list until you find a character that's not 'a.'
# Intuition
Skip all the beginning 'a,' then flip characters until you find another 'a.'

# Approach
Iterate through the list until you find a character that's not 'a.' If the whole list is 'a,' convert the last letter to 'z.' Otherwise, flip each following letter using chr() and ord() until you find another 'a,' in which case return the string.

# Complexity
- Time complexity:
O(n)

- Space complexity:
O(n)

# Code
```python3 []
class Solution:
    def smallestString(self, s: str) -> str:
        i, s = 0, list(s)
        while i < len(s) and s[i] == 'a':
            i += 1
        
        if i == len(s):
            s[-1] = 'z'

        while i < len(s) and s[i] != 'a':
            s[i] = chr(ord(s[i]) - 1)
            i += 1

        return ''.join(s)

```
['Python3']