class Solution(object):

    def titleToNumber(self, s):
        """
        :type s: str
        :rtype: int
        """
        res = 0
        s = s[::-1]
        w = 1
        for each in s:
            res += (ord(each) - 64) * w
            w = w * 26
        return res

be98d19f0f1e8943f4713b81648c8b3614a1069b
<mask token>

class Solution(object):
    <mask token>

class Solution(object):

    def titleToNumber(self, s):
        """
        :type s: str
        :rtype: int
        """
        res = 0
        s = s[::-1]
        w = 1
        for each in s:
            res += (ord(each) - 64) * w
            w = w * 26
        return res
