C Solution
Method: \n- Replace all prefix substring chars before character \'a\' in s to its preceding character\n- If all characters in s is \'a\', then, replace last \'a
**Method:** \n- Replace all prefix substring chars before character \'a\' in s to its preceding character\n- If all characters in s is \'a\', then, replace last \'a\' character to \'z\'\n\n**Time:** O(n)   \n**Space:** O(1)\n\n```\nchar* smallestString(char* s) {\n    int i = 0, len = strlen(s);\n    \n    while(i < len && s[i] == \'a\') i++;\n    \n    if(i == len) {\n        s[len - 1] = \'z\';\n        return s;\n    }\n    \n    // replace all prefix substring characters before \'a\' in s \n    // by its preceding character    \n    while(i < len && s[i] != \'a\') s[i++]--;\n    \n    return s;\n}\n```
['C']