#
# @lc app=leetcode.cn id=171 lang=python3
#
# [171] Excel表列序号
#

# @lc code=start
class Solution:
    def titleToNumber(self, s: str) -> int:
        res = 0
        for c in s:
            x = ord(c) - ord('A') + 1
            res = res * 26 + x
        return res
# @lc code=end

sl = Solution()
res = sl.titleToNumber('ZY')
print(res)
d334a9d6f62b7a2d64a14d37daa4514831349931
class Solution:
    <mask token>


<mask token>

class Solution:

    def titleToNumber(self, s: str) ->int:
        res = 0
        for c in s:
            x = ord(c) - ord('A') + 1
            res = res * 26 + x
        return res


<mask token>

class Solution:

    def titleToNumber(self, s: str) ->int:
        res = 0
        for c in s:
            x = ord(c) - ord('A') + 1
            res = res * 26 + x
        return res


<mask token>
print(res)

class Solution:

    def titleToNumber(self, s: str) ->int:
        res = 0
        for c in s:
            x = ord(c) - ord('A') + 1
            res = res * 26 + x
        return res


sl = Solution()
res = sl.titleToNumber('ZY')
print(res)

#
# @lc app=leetcode.cn id=171 lang=python3
#
# [171] Excel表列序号
#

# @lc code=start
class Solution:
    def titleToNumber(self, s: str) -> int:
        res = 0
        for c in s:
            x = ord(c) - ord('A') + 1
            res = res * 26 + x
        return res
# @lc code=end

sl = Solution()
res = sl.titleToNumber('ZY')
print(res)