Easy python solution


  • 0
    A
    def titleToNumber(self, s):
        letters = list(s)
        result = 0
        for i in xrange(len(letters)):
            colNum = ord(letters[i]) - 64
            result += colNum * 26 ** (len(letters) - 1 - i)
        return result

Log in to reply
 

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