easy solution after minimal thought process
Intuition\n Describe your first thoughts on how to solve this problem. \nso the intial thought of every person would be to make the starting part of the string 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nso the intial thought of every person would be to make the starting part of the string minimum,that\'s what i did\n--\n# Approach\n<!-- Describe your approach to solving the problem. -->\njust traverse upto the index which is not a then then from their start decreasing the characters by one until you reach another \'a\'\n--\nif the given string only consits of an \'a\' then return s string s by replacing the last character of the string with an \'z\' as given in the examples \n--\nThank you || upvote me\n--\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(n)$$\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(n)$$\n# Code\n```\nclass Solution {\npublic:\n    string smallestString(string s) {\n        int n = s.size();\n        int i = 0;\n        while(i < n && s[i] == \'a\') i++;\n        if(i == n){\n            s[n-1] = \'z\';\n            return s;\n        }\n        while(i < n && s[i] != \'a\'){\n          s[i] = s[i]-1;\n          i++;\n        }\n        return s;\n    }\n};\nauto init = [](){\n    ios::sync_with_stdio(0);\n    cin.tie(0);\n    cout.tie(0);\n    return \'c\';\n}();\n```
['C++']