Python solution beats 100%. Just write down all the combinations.
Im sorry for my terrible naming skills\n# Code\n\nclass Solution:\n    def smallestString(self, s: str) -> str:\n        def onego(s):\n            return "".jo
Im sorry for my terrible naming skills\n# Code\n```\nclass Solution:\n    def smallestString(self, s: str) -> str:\n        def onego(s):\n            return "".join(chr(ord(x)-1) for x in s)\n\n        if s == \'a\':\n            return \'z\'\n        elif \'a\' not in s:\n            return onego(s)\n        elif s.count(\'a\') == 1:\n            if s[0] == \'a\':\n                return \'a\'+onego(s[1:])\n            else:\n                return onego(s[:s.index(\'a\')])+s[s.index(\'a\'):]\n        else:\n            if s[0] != \'a\':\n                return onego(s[:s.index(\'a\')])+s[s.index(\'a\'):]\n\n            elif len(s) == s.count(\'a\'):\n                return s[:-1]+\'z\'\n            else:\n                idx = 0\n                for i in range(len(s)):\n                    if s[i] == \'a\':\n                        continue\n                    else:\n                        idx = i\n                        break\n                if \'a\' not in s[idx:]:\n                    return s[:idx]+onego(s[idx:])\n                else:\n                    ss = s[idx:]\n                    ii = idx + ss.index(\'a\')\n                    return s[:idx]+onego(s[idx:ii])+s[ii:]\n```
['Python3']