Python 3 || 9 lines,  w/ explanation  || T/S: 99% / 93%
Here\'s the plan:\n\n1. We iterate across the ords of the characters in s.\n\n1. If the value of k is sufficient, we move each character of s to a along the sho
Here\'s the plan:\n\n1. We iterate across the *ords* of the characters in `s`.\n\n1. If the value of `k` is sufficient, we move each character of `s` to *a* along the shortest path for that character and decrement `k` accordingly.\n1. If the value of `k` is not sufficient, we spend all of `k` to move a character as far forward toward *a* as possible.\n1. We append any tail of `s` left after `k` is exhausted.\n\n\n```\nclass Solution:\n    def getSmallestString(self, s: str, k: int, ans = \'\' ) -> str:\n\n        for i, num in enumerate(map(lambda x: ord(x) - 97, s)):\n                                                # <--1)\n            dist = min(num, 26 - num)\n            if dist <= k:                       # <--2)\n                k-= dist\n                ans+= \'a\'\n            else: \n                ans+= chr(num + 97 - k)         # <--3)\n                break\n\n        return ans + s[i+1:]                    # <--4)\n```\n[https://leetcode.com/problems/lexicographically-smallest-string-after-operations-with-constraint/submissions/1266897847/](https://leetcode.com/problems/lexicographically-smallest-string-after-operations-with-constraint/submissions/1266897847/)\n\n\n\nI could be wrong, but I think that time complexity is *O*(*N*) and space complexity is *O*(*N*), in which *N* ~ `len(s)`.
['Python3']