Simple Video Solution with TC: O(26*N)->O(N) 🔥
Easy Video Solution\n\nhttps://youtu.be/qr_2aqMARWE\n\n# Code\n\nclass Solution {\npublic:\n    string getSmallestString(string s, int k) {\n        string ans=
# Easy Video Solution\n\nhttps://youtu.be/qr_2aqMARWE\n\n# Code\n```\nclass Solution {\npublic:\n    string getSmallestString(string s, int k) {\n        string ans="";\n        int n=s.size();\n        for(int i=0;i<n;i++) {\n            int f=0;\n            for(char ch=\'a\';ch<=\'z\';ch++) {\n                int d1=abs((s[i]-\'a\')-(ch-\'a\'));\n                int d2=26-d1;\n                int d=min(d1,d2);\n                if(d<=k) {\n                    f=1;\n                    ans.push_back(ch);\n                    k=k-d;\n                    break;\n                }\n            }\n            if(f==0)\n                ans.push_back(s[i]);\n        }\n        return ans;\n    }\n};\n```
['Math', 'String Matching', 'C++']