*Iterate and consider 3 cases.. Simple Python 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:\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:\n    def getSmallestString(self, s: str, k: int) -> str:\n        \n        def a_dist(string):\n            if ord(string) - ord(\'a\') <= 13:\n                return True\n            return False \n\n        res = []\n        for i in range(len(s)):\n            idx = ord(s[i]) - ord(\'a\') + 1 \n            print(\'idx: \',idx)\n            # can be made \'a\' #case 1 : when char is close to a :: \n            if idx - k <= 0 and  a_dist(s[i]):\n                res.append(\'a\')\n                diff = ord(s[i]) - ord(\'a\') \n                k -= diff\n            # can be made \'a\' #case 2 : when char is close to z :: \n            elif idx + k > 26 and not a_dist(s[i]):\n                res.append(\'a\')\n                diff = ord(\'z\') - ord(s[i]) + 1\n                k -= diff\n            #when char cannot be made \'a\' .. exhaust k and append rest of the list \n            else:\n                new_char = chr(ord(s[i]) - k)\n                res.append(new_char) \n                res.append(s[i+1:])\n                break\n        # print(res)\n        return \'\'.join(res)\n```
['Python3']