C++, Easy to Understand, Commented code with explanation
Complexity\n- Time complexity:\n-- O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:\n-- O(1)\n Add your space complexity here, e.g. O(n) 
# Complexity\n- Time complexity:\n-- O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n-- O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string smallestString(string s) {\n        int n = s.size();\n        int start;\n        int end;\n        \n        int i = 0;\n        //ignoring starting continous sbtstring of a\'s\n        if(s[i]==\'a\') {\n            while(s[i]==\'a\' && i<n) {\n                i++;\n            }\n        }\n\n        //assigning the start pointer to the 1st non \'a\' char in s\n        start = i;\n\n        while(s[i]!=\'a\' && i<n) {\n            i++;\n        }\n        end = i;\n        //assigning the end pointer to the next char of 2nd founded \'a\'\n\n        //now let\'s make all char one step low between start to end\n        bool flag = 0; \n        for(int i=start;i<end;i++) {\n            s[i]--;\n            flag = 1;\n        }\n        end--;\n        //pointing end pointer on the 2nd founded \'a\'\n\n        //if flag is 0 it means\n        //there are no char modified, it\'s means\n        //it was char \'a\', and we have to make it \'z\'\n        if(flag==0 && end>=0 && end<n) {\n            s[end] = \'z\';\n        }\n        return s;\n    }\n};\n```
['Two Pointers', 'C++']