题目 Given a column title as appear in an Excel sheet, return its corresponding column number. 解题思路 相当于将26进制数转换成10进制数 代码 class Solution: def titleToNumber(self, s: str) -> int: res = 0 for c in s: res = res * 26 + ord(c) - 64 return res 视频讲解 YouTube<--欢迎点击订阅 视频讲解 bilibili<--欢迎点击订阅 Previous LeetCode 994 Rotting Oranges (Python) Next LeetCode 274 H-Index (Python)