Easily understandable O(n) solution
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: 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        int n=s.size();\n        for(int i=0; i<n; i++){\n            \n            int x=(s[i]-\'a\');\n            int mindis=x<13?x:(26-x);\n            if(k>=mindis){\n                k-=mindis;\n                s[i]=\'a\';\n            }\n            else{\n                s[i]=char(s[i]-k);\n                k=0;\n            }\n            if(k==0)    break;\n        }\n        return s;\n    }\n};\n```
['C++']