Simple Python3 Solution


  • 0
    Z
    class Solution(object):
        def convertToTitle(self, n):
            """
            :type n: int
            :rtype: str
            """
            resultStr = ''
            while n != 0:
                n = n - 1
                resultStr += chr(n % 26 + 65)
                n //= 26
            return resultStr[::-1]
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.