C++ ||EASY || WITH EXPLANATION
The logic to get lexicographically smallest so skip all a if u reach last then replace with \'Z\' and return .Otherwise change each character to smaller charact
The logic to get lexicographically smallest so skip all a if u reach last then replace with \'Z\' and return .Otherwise change each character to smaller character till u reach end of string.\n**Please Upvote if it Helped!**\n\n```\nclass Solution {\npublic:\n    string smallestString(string s) {\n        int i=0;\n        int n=s.size();\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    }\n};\n
['String', 'C']