Java || Easy
Code\n\nclass Solution {\n    public String smallestString(String s) {\n        char[] ch = s.toCharArray();\n        int i = 0;\n        if(ch[0] == \'a\') {  
# Code\n```\nclass Solution {\n    public String smallestString(String s) {\n        char[] ch = s.toCharArray();\n        int i = 0;\n        if(ch[0] == \'a\') {     \n            while(i < ch.length && ch[i] == \'a\') i++;\n            if(i == ch.length) {\n                ch[i-1] = \'z\';\n                return String.valueOf(ch);\n            }\n        }\n        \n        if(ch[i] != \'a\') {\n            while(i < ch.length && ch[i] != \'a\') {\n                ch[i] = (char)(ch[i] - 1);\n                i++;\n            }\n        }\n        return String.valueOf(ch);\n    }\n}\n```
['Java']