✅Easy and Simple ✅Clean Code
Guy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F\nFoll
***Guy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F***<br>\n**Follow me on LinkeDin [[click Here](https://www.linkedin.com/in/ayushluthra62/)]**\n\n# Complexity\n- Time complexity:\nO(N)\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution {\npublic:\n    string getSmallestString(string s, int k) {\n        if(k == 0) return s;\n        int curr =0;\n        for(int i=0;i<s.length();i++){\n            int right = (\'z\'-s[i])+1;\n            int left = s[i]-\'a\';\n            int mini = min(left,right);\n            if(k>=mini){\n                s[i]=\'a\';\n                k-=mini;\n            }else{\n                char ch =s[i]-k;\n                s[i]=ch;\n                k=0;\n            }\n        }\n        return s;\n    }\n};\n```\n***Guy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F***<br>\n**Follow me on LinkeDin [[click Here](https://www.linkedin.com/in/ayushluthra62/)]**
['String', 'Greedy', 'C++']