题目描述:

方法一:asiic码

class Solution:
def convertToTitle(self, n: int) -> str:
if (n-1)//26 == 0:
return chr(65+(n-1) % 26)#参数是0 - 256 的一个整数,返回值是当前整数对应的ascii字符。参数可以是10进制也可以是16进制的形式
else:
return self.convertToTitle((n-1)//26) + chr(65 +(n-1)%26)

leetcood学习笔记-168-excel表列名称的更多相关文章

  1. LeetCode 168. Excel表列名称(Excel Sheet Column Title)

    168. Excel表列名称 168. Excel Sheet Column Title 题目描述 给定一个正整数,返回它在 Excel 表中相对应的列名称. LeetCode168. Excel S ...

  2. leetcode 实现-168.Excel表列名称

    168.Excel表列名称 描述 给定一个正整数,返回它在 Excel 表中相对应的列名称. 例如, 1 -> A 2 -> B 3 -> C … 26 -> Z 27 -&g ...

  3. Java实现 LeetCode 168 Excel表列名称

    168. Excel表列名称 给定一个正整数,返回它在 Excel 表中相对应的列名称. 例如, 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -&g ...

  4. 刷题-力扣-168. Excel表列名称

    168. Excel表列名称 题目链接 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/excel-sheet-column-title 著作权 ...

  5. LeetCode 168. Excel表列名称(Excel Sheet Column Title)

    题目描述 给定一个正整数,返回它在 Excel 表中相对应的列名称. 例如, 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 - ...

  6. 力扣168. Excel表列名称

    原题 1 class Solution: 2 def convertToTitle(self, n: int) -> str: 3 s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ ...

  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. 168 Excel Sheet Column Title Excel表列名称

    给定一个正整数,返回它在Excel表中相对应的列名称.示例:    1 -> A    2 -> B    3 -> C    ...    26 -> Z    27 -&g ...

  9. LeetCode168.Excel表列名称

    给定一个正整数,返回它在 Excel 表中相对应的列名称. 例如, 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> ...

  10. 【leetcode 简单】第三十九题 Excel表列名称

    给定一个正整数,返回它在 Excel 表中相对应的列名称. 例如, 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> ...

随机推荐

  1. Ansible的roles标准化与Jenkins持续集成(三)

    Ansible的roles标准化与Jenkins持续集成(三) 链接:https://pan.baidu.com/s/1A3Iq3gGkGS27L_Gt37_I0g 提取码:ncy2 复制这段内容后打 ...

  2. Lambda select 动态字段

    直接上代码 //测试数据 public static List<User> myList = new List<User>() { , Name=,IsChild=false} ...

  3. 【datatable】正在加载中的信息提示

    datatable插件 DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool, ...

  4. 【转载】网易极客战记官方攻略-地牢-严酷考验 B

    关卡连接:https://codecombat.163.com/play/level/the-gauntlet-b 免费试玩:https://codecombat.163.com/play 使用你的所 ...

  5. java随笔记录

    JAVA的变量类型 类变量:独立于方法之外的变量,用 static 修饰. 实例变量:独立于方法之外的变量,不过没有 static 修饰. 局部变量:类的方法中的变量. public class Va ...

  6. redis缓存的安装和使用(转)

    redis缓存的安装和使用 转载自:http://www.open-open.com/lib/view/open1384091914836.html Redis介绍    Redis本质上一个Key/ ...

  7. hibernate调用oracle存储过程||函数

    pakeage dao.Impl; //调用函数FUN_GET(); public String get(String Id,String Name){ return getSession().cre ...

  8. vue-cli下的vuex的极简Demo(实现加1减1操作)

    1.vue-cli搭建好项目之后,使用npm安装vuex npm install vuex --save 2.在项目目录中构建vuex目录(这里我新建了store的文件夹,里面新建了store.js文 ...

  9. 【LeetCode 2】两数相加

    描述 [题解] 模拟高精度的加法. 用x来记录前面的进位就好. [代码] /** * Definition for singly-linked list. * struct ListNode { * ...

  10. Ext 行模型与Grid视图

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...