My python solution


  • 0
    B
    class Solution(object):
    def titleToNumber(self, s):
        list1 = [ord(x)-64 for x in s]
        list2 = [pow(26,x) for x in range(len(s))[::-1]]
        return sum([x*y for x,y in zip(list1,list2)])

Log in to reply
 

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