Python: Naive

  • 0
    class Solution(object):
        def convertToTitle(self, n):
            # Trying to make it faster, but seems all solution have some little variation and fall approx on the same coordinates 
            title = []
            while n:
                n, rem = divmod(n - 1, 26)
            return "".join(title[::-1])

Log in to reply

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