Use the elementary function to compute it.

```
class Solution(object):
def titleToNumber(self, s):
"""
:type s: str
:rtype: int
"""
return sum((ord(sub) - ord('A') + 1) * 26 ** i for i, sub in enumerate(s[::-1]))
```