Excel Sheet
168. Excel Sheet Column Title 思路: 數字 轉 字母. reference map 0 ~ 25 對應到 A - Z 所以在處理n 的時候要 做 (n - 1) // 26. 26 => (26 - 1) % 26 = 25, ref[25] = 'Z' class Solution(object): def convertToTitle(self, n): """ :type n: int :rtype: str """ dic = {} res = [] for i in range(65, 91): dic[i - 65] = str(unichr(i)) while n: res.insert(0, dic[(n-1) % 26]) n = (n-1) // 26 return "".join(res) 171. ...