O(n) Time O(1) Space, Simplest
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n#include <bits/stdc++.h>\nusing namespace std;\n\nclass Solution\n{\npublic:\n    string getSmallestString(string s, int k)\n    {\n        int n = s.size();\n        for (int i = 0; i < n; i++)\n        {\n            int minDist = min(s[i] - \'a\', \'z\' - s[i] + 1); \n            if (minDist <= k)\n            {\n                k -= minDist; \n                s[i] = \'a\';   \n            }\n            else\n            {\n                s[i] = char(s[i] - k);\n                k = 0; \n            }\n        }\n        return s;\n    }\n};\n\n```
['Greedy', 'C++']