标签:
Given a column title as appear in an Excel sheet, return its corresponding column number.
For example:
A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28
26进制下ASCII码的转换
class Solution: def(self,s): sum = 0 for x in s: sum = 26*sum + x - ord(‘A‘) + 1 return sum
Leetcode 171 Excel Sheet Column Number
标签:
原文地址:http://www.cnblogs.com/lilixu/p/4631425.html