Python efficient Solution


#1

An easy python solution
def titleToNumber(self, A):
res = 0
for i in range(len(A)):
res+= (ord(A[i])-64)*(26**(len(A)-i-1))
return res