C++ || Easy Strings || ✔✔
Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n\n# Co
# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string getSmallestString(string s, int k) {\n        for (int i=0; i<s.size(); i++){\n            int dis= min(s[i]-\'a\',\'z\'-s[i]+1);\n            if (dis<=k){\n                s[i]=\'a\';\n                k-= dis;\n            }else{\n                s[i]= min(s[i],char(s[i]-k));\n                k=0;\n                break;\n            }\n        }\n        return s;\n    }\n};\n```
['String', 'Greedy', 'C++']