class Solution(object):
    def convertToTitle(self, n):
        """
        :type n: int
        :rtype: str
        """
        res=''
        while n>0:
            tmp=n
            n=(n-1)/26
            res+=chr(65+(tmp-1)%26)
        
        return res[::-1]

【leetcode❤python】 168. Excel Sheet Column Title的更多相关文章

  1. 【leetcode❤python】171. Excel Sheet Column Number

    #-*- coding: UTF-8 -*- # ord(c) -> integer##Return the integer ordinal of a one-character string. ...

  2. 【LeetCode】168. Excel Sheet Column Title 解题报告(Java & Python & C++)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 迭代 递归 日期 [LeetCode] 题目地址:https: ...

  3. 【LeetCode】168. Excel Sheet Column Title

    题目: Given a positive integer, return its corresponding column title as appear in an Excel sheet. For ...

  4. 【easy】168. Excel Sheet Column Title 171. Excel Sheet Column Number

    class Solution { public: string convertToTitle(int n) { ) { return ""; } ) / ) + () % + 'A ...

  5. 【LeetCode】168 & 171- Excel Sheet Column Title & Excel Sheet Column Number

    168 - Excel Sheet Column Title Given a positive integer, return its corresponding column title as ap ...

  6. 168. Excel Sheet Column Title

    Excel Sheet Column Title Given a positive integer, return its corresponding column title as appear i ...

  7. [LeetCode] 168. Excel Sheet Column Title 求Excel表列名称

    Given a positive integer, return its corresponding column title as appear in an Excel sheet. For exa ...

  8. leetcode 168. Excel Sheet Column Title 171 Excel Sheet Column Number

    题目 //像10进制一样进行 转换   只是要从0开始记录 class Solution { public: string convertToTitle(int n) { char a; string ...

  9. 【原创】leetCodeOj --- Excel Sheet Column Title 解题报告

    题目地址: https://oj.leetcode.com/problems/excel-sheet-column-title/ 题目内容: Given a positive integer, ret ...

随机推荐

  1. ms-sql关联表操作

    1.创建数据库employee : create database employee;2.创建员工表EMP:use employee;create table EMP( id int,sex varc ...

  2. nmon监控工具的使用

    该工具的使用主要参考自http://blog.itpub.net/23135684/viewspace-626439/ http://nmon.sourceforge.net/pmwiki.php 生 ...

  3. spring boot 添加jsp支持注意事项

    1.一定要使用war包<packaging>war</packaging>2.将provided改为compile,具体如下: <dependency> <g ...

  4. Python中的传值和引用

    我写这个主要是给自己看,内容也就是便于自己理解,可能会不正确,但目前来看代码测试的结果是对的. python中一切皆对象. 当我们赋值时: a = 1 其实是先创建了一个整数常量1(也是一个对象,且已 ...

  5. svm机器学习算法中文视频讲解

    这个是李政軒Cheng-Hsuan Li的关于机器学习一些算法的中文视频教程:http://www.powercam.cc/chli. 一.KernelMethod(A Chinese Tutoria ...

  6. 利用lambda和Collection.forEach

    2.外部VS内部迭代 以前Java集合是不能够表达内部迭代的,而只提供了一种外部迭代的方式,也就是for或者while循环. 1 2 3 4 List persons = asList(new Per ...

  7. String

    [] 中的索引 a = "hello there" a[1]                   #=> "e" a[2, 3]              ...

  8. VB中键盘每个按键所对应的具体数值是?

    键码常数 值 描述 vbKeyLButton 1 鼠标左键 vbKeyRButton 2 鼠标右键 vbKeyCancel 3 CANCEL 键 vbKeyMButton 4 鼠标中键 vbKeyBa ...

  9. python学习笔记之类class(第六天)

         参考文档:              1.金角大王博客:http://www.cnblogs.com/alex3714/articles/5188179.html               ...

  10. python学习笔记之迭代器和函数(第三天)

    一.collection系列: 1.counter计数器 如果counter(dict)是对字典的一个补充,如果counter(list)则是对列表的补充,初步测试对字典的值进行排序. ####### ...