Iterative, Simple with Approach ✅| O(n)
Code me a cup of coffee with an upvote on top! \u2615\uFE0F\uD83D\uDC4D\n\nApproach : \n\n- The variable count is initialized to 0, which will be used to track 
**Code me a cup of coffee with an upvote on top! \u2615\uFE0F\uD83D\uDC4D**\n\n**Approach** : \n\n- The variable count is initialized to 0, which will be used to track the number of characters that are modified.\n\n- The code then iterates over each character in the string s from left to right.\n\n- If the current character s[i] is greater than \'a\', it means it can be replaced with the previous character of the English alphabet. So, the code replaces s[i] with s[i] - 1 and increments the count variable.\n\n- If the current character is \'a\' and the count variable is non-zero, it means we have already modified some characters previously. In this case, we break out of the loop to avoid modifying any more characters.\n\n- After the loop, if the count variable is still 0, it means that all characters in the string were originally \'a\'. In this case, we update the last character s[s.size() - 1] to \'z\' to obtain the lexicographically smallest string.\n\n- Finally, the function returns the modified string s.\n\n```\nstring smallestString(string s) {\n    \n        int count=0;\n        for(int i=0;i<s.size();i++){\n            if(s[i]>\'a\'){\n                s[i]=s[i]-1;\n                count++;\n            }\n            else if(count){\n                break;\n            }\n        }\n        if(count==0){\n            s[s.size()-1]=\'z\';\n        }\n        return s;\n    }\n\n```\n\n**Code me a cup of coffee with an upvote on top! \u2615\uFE0F\uD83D\uDC4D**
['C', 'Iterator']