171.Excel Sheet Column Number

class Solution:
    def titleToNumber(self, s: str) -> int:
        ans = 0
        for i in range(len(s)):
            ans = ans * 26 + ord(s[i])-64
        return ans
原文地址:https://www.cnblogs.com/luo-c/p/12857409.html