C++ solution
\n// Please, upvote if you like it. Thanks :-)\nstring getSmallestString(string s, int k) {\n\tint n = s.size();\n\tfor (int i = 0; i < n & k > 0; i++) {\n\t\ti
```\n// Please, upvote if you like it. Thanks :-)\nstring getSmallestString(string s, int k) {\n\tint n = s.size();\n\tfor (int i = 0; i < n & k > 0; i++) {\n\t\tint dist = min(s[i] - \'a\', \'z\' - s[i] + 1);\n\t\ts[i] = (dist <= k ? \'a\' : s[i] - k);\n\t\tk -= dist;\n\t}\n\treturn s;\n}\n```
['Greedy', 'C', 'C++']