夏木之下

关注

168. Excel表列名称 (Python 实现)

夏木之下

关注

阅读 44

2022-01-04

题目:

例如:

示例 1:

示例 2:

示例 3:

示例 4:

代码:

class Solution:
    def convertToTitle(self, columnNumber: int) -> str:
        num = columnNumber
        s = ''
        while num > 0:
            num -= 1
            a, b = num//26, num%26
            s += chr(b+65)
            num = a
        return s[::-1]

相关推荐

寒羽鹿

168. Excel表列名称

寒羽鹿 54 0 0

他说Python

力扣:168. Excel表列名称(Python3)

他说Python 37 0 0

时光已翩然轻擦

python 练习题- letcode 168. Excel表列名称

时光已翩然轻擦 60 0 0

seuleyang

【力扣】168. Excel表列名称、171. Excel 表列序号

seuleyang 12 0 0

GhostInMatrix

LeetCode | 168.Excel表列名称

GhostInMatrix 32 0 0

捡历史的小木板

leetcode算法168.Excel表列名称

捡历史的小木板 49 0 0

爱上流星雨

LeetCode-168. Excel表列名称(java)

爱上流星雨 58 0 0

瑾谋

LeetCode力扣 168. Excel表列名称 Excel Sheet Column Title 题解代码 JavaScript

瑾谋 70 0 0

编程练习生J

Excel表列名称

编程练习生J 104 0 0

西特张

LeetCode刷题笔记第168题:Excel表列名称

西特张 6 0 0

精彩评论(0)

0 0 举报