PYTHON FOR BEGINNERS
\tclass Solution:\n    def getSmallestString(self, n: int, k: int) -> str:\n        cantZ,rest,cantA,ch,backZ,digits=0,0,0,0,0,n\n        cantZ=k//26\n        r
\tclass Solution:\n    def getSmallestString(self, n: int, k: int) -> str:\n        cantZ,rest,cantA,ch,backZ,digits=0,0,0,0,0,n\n        cantZ=k//26\n        rest=k%26\n        if rest>digits-cantZ:\n            cantA=digits - cantZ-1\n            ch=rest-cantA\n            return "a"*cantA +chr(ch+96)+"z"*(cantZ)  \n        if rest==digits-cantZ:\n            cantA=digits - cantZ\n            return "a"*cantA +"z"*(cantZ)   \n        else:\n            if rest==0 and cantZ==n:\n                return "z"*cantZ\n            else:\n                while True:\n                    backZ=((digits-cantZ-rest)//26)+1\n                    cantZ=cantZ-backZ\n                    rest=rest+backZ*26\n                    cantA=digits - cantZ-1              \n                    ch=rest-cantA             \n                    if ch>0 and ch<26:\n                        break            \n                return "a"*cantA +chr(ch+96)+"z"*(cantZ)
[]