Short and intuitive greedy method: TC(26n) + SC(1)
Complexity\n- Time complexity: O(26n)\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# 
# Complexity\n- Time complexity: O(26n)\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        int n = s.size();\n        for (int i = 0; i < n; i++) {\n            char oldCh = s[i];\n            s[i] = \'a\';\n            while (k - min(26-abs(s[i]-oldCh), abs(s[i]-oldCh)) < 0)\n                s[i]++;\n            k -= min(26-abs(s[i]-oldCh), abs(s[i]-oldCh));\n        }\n        return s;\n    }\n};\n```
['Greedy', 'C++']