Python solution


  • 0
    G

    '''

    def convertToTitle(self, n):
        q=[]
        while n!=0:
            q.append(n%26)
            if n%26==0:
                n=n//26-1
            else:
                n=n//26
        q.reverse()
        s=[string.ascii_uppercase[i-1] for i in q]
        return ''.join(s)
    

    '''


Log in to reply
 

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