Beats 100% && Simple && C++
\n# Code\n\nclass Solution {\npublic:\n    string smallestString(string s) {\n        ios_base::sync_with_stdio(false);\n        cin.tie(0);\n        cout.tie(0
\n# Code\n```\nclass Solution {\npublic:\n    string smallestString(string s) {\n        ios_base::sync_with_stdio(false);\n        cin.tie(0);\n        cout.tie(0);\n        int sa = 0 , ea = s.length();\n        // Get the starting position of a\n        for(int i = 0 ; i < s.length() ; i++){\n            if(s[i] == \'a\'){\n                sa++;\n            }\n            else{\n                break;\n            }\n        }\n        // If string contain all a handle this case\n        if(sa == s.length())\n        {\n            s[sa-1] = \'z\';\n            return s;\n        }\n        // Find first occurance of a after sa\n        for(int i = sa ; i < s.length() ; i++)\n        {\n            if(s[i] == \'a\'){\n                ea = i;\n                break;\n            }\n            \n        }\n        // since we are sure there is no a between sa and ea\n        for(int i = sa ; i < ea ; i++){\n            char c = s[i];\n            c--;\n            s[i] = c;\n        }\n        return s;\n\n\n    }\n};\n```
['String', 'C++']