✅ Python Solution
\nclass Solution:\n    def getSmallestString(self, n: int, k: int) -> str:\n        ans = \'\'\n        while (n - 1) * 26 >= k:\n            ans += \'a\'\n    
```\nclass Solution:\n    def getSmallestString(self, n: int, k: int) -> str:\n        ans = \'\'\n        while (n - 1) * 26 >= k:\n            ans += \'a\'\n            n -= 1; k -= 1\n        ans += chr(ord(\'a\') + (k % 26 or 26) - 1)\n        ans += \'z\' * (n - 1)\n        return ans\n```
['Python', 'Python3']