```
class Solution(object):
def titleToNumber(self, s):
"""
:type s: str
:rtype: int
"""
l = list(s)
return self.solv(l,0)
def solv(self,l,sum):
sum = sum + pow(26,len(l)-1) * (ord(l[0]) % ord('A') + 1)
del l[0]
if len(l):
sum = self.solv(l,sum)
return sum
```