One Line Python Solution


  • 1
    def titleToNumber(self, s):
            return sum([ (ord(s[i])-ord('A')+1)*pow(26,(len(s)-i-1)) for i in range(len(s))])
    

Log in to reply
 

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