[Python3]  O(n) time and O(1) space complexity solution
python3\nclass Solution:\n    def getSmallestString(self, n: int, k: int) -> str:\n        result =[0]*n\n        for position in range(n-1,-1,-1):\n           
``` python3\nclass Solution:\n    def getSmallestString(self, n: int, k: int) -> str:\n        result =[0]*n\n        for position in range(n-1,-1,-1):\n            add = min(k -position,26)\n            result[position] = chr(ord("a")+add -1)\n            k-=add\n            \n        return "".join(result)\n```\n\nComplexity :\n\nTime : O(n), as we iterate over n positions to build the result.\n\nSpace : O(1), as we use constant extra space to store add and position variables.
['Python', 'Python3']