Correct simple Python solution without loop
\nclass Solution:\n    def getSmallestString(self, n: int, k: int) -> str:\n        q, r = divmod(k - n, 25)\n        return (\'a\'*(n - q - 1) + chr(ord(\'a\')
```\nclass Solution:\n    def getSmallestString(self, n: int, k: int) -> str:\n        q, r = divmod(k - n, 25)\n        return (\'a\'*(n - q - 1) + chr(ord(\'a\') + r) if q < n else \'\') + \'z\'*q\n```\n\n* the smallest string is a string like aaa...aszzz...z\n-- a - smallest char (0 to n length)\n-- s - char on the border (0 or 1 length)\n-- z - largest char (0 to n length)\n\n\n\nP.S. The solution correctly handles edge cases n=3, k=78.
['Math', 'Python']