Easy solution in C++
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```\nclass Solution {\npublic:\nint getMinDiff(char one, char two)\n{\n    int diff1 = abs(two - one);\n    int diff2 = abs((\'z\' - two) + (one - \'a\') + 1);\n    int diff3 = abs(one - two);\n    int diff4 = abs((\'z\' - one) + (two - \'a\') + 1);\n    int ans = min({diff1, diff2, diff3, diff4});\n    return ans;\n}\n\nchar getMinChar(char ch, int k)\n{\n    char ans1 = \'a\';\n    char ans2 = \'a\';\n    for (int i = 0; i < 26; i++)\n    {\n        char one = \'a\' + i;\n        if (getMinDiff(ch, one) == k)\n        {\n            ans1 = one;\n            break;\n        }\n    }\n    for (int i = 26; i >= 0; i--)\n    {\n        char one = \'a\' + i;\n        if (getMinDiff(ch, one) == k)\n        {\n            ans2 = one;\n            break;\n        }\n    }\n    char ans = min(ans1, ans2);\n    return ans;\n}\n\nstring getSmallestString(string s, int k)\n{\n    for (int i = 0; i < s.size() && k > 0; i++)\n    {\n        int diff = getMinDiff(s[i], \'a\');\n        if (diff <= k)\n        {\n            k -= diff;\n            s[i] = \'a\';\n        }\n        else\n        {\n            char ch = getMinChar(s[i], k);\n            s[i] = ch;\n            k = 0;\n            break;\n        }\n    }\n\n    return s;\n}\n};\n```
['C++']