Simple JavaScript Solution
Code\n\n/**\n * @param {string} s\n * @return {string}\n */\nvar smallestString = function(s) {\n    let started = false;\n    let output = \'\';\n\n    let cur
# Code\n```\n/**\n * @param {string} s\n * @return {string}\n */\nvar smallestString = function(s) {\n    let started = false;\n    let output = \'\';\n\n    let curCharCode;\n\n    for(let i = 0; i < s.length; i++){\n        if((s[i] !== \'a\' && !started) || (i == s.length - 1 && !started) ){\n            started = true;\n            output = s.slice(0, i);\n        }\n        else if(s[i] === \'a\' && started){\n            output += s.slice(i);\n            break;\n        }\n        \n        if(started){\n            curCharCode = s.charCodeAt(i);\n            output += String.fromCharCode(curCharCode === 97 ? 122 : curCharCode - 1);\n        }\n    }\n\n    return output != \'\' ? output : s;\n};\n```
['JavaScript']