class Solution: def convertToTitle(self, n: int) -> str: ans = "" while n: a = (n-1) % 26 n = (n-1) // 26 ans = chr(ord('A') + a) + ans return ans