当前位置:网站首页>Excel sheet column title for leetcode Title Resolution
Excel sheet column title for leetcode Title Resolution
2022-06-23 05:50:00 【ruochen】
Given a positive integer, return its corresponding column title as appear in an Excel sheet.
For example:
1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB
public String convertToTitle(int n) {
if (n < 27) {
return (char) ('A' + (n - 1)) + "";
}
if (n % 26 == 0) {
return convertToTitle(n / 26 - 1) + 'Z';
}
return convertToTitle(n / 26) + convertToTitle(n % 26);
}边栏推荐
- ORB_SLAM2运行
- mysql字符集
- Raspberry pie assert preliminary exercise
- Deploy docker and install MySQL in centos7
- The author believes that the so-called industrial Internet is a process of deep integration of industry and the Internet
- MySQL Foundation
- ORB_ Slam2 operation
- 数字藏品赋能实体产业释放了哪些利好?
- @jsonfield annotation in fastjson
- Real MySQL interview question (30) -- shell real estate order analysis
猜你喜欢

51万奖池邀你参战——第二届阿里云ECS CloudBuild开发者大赛来袭

jvm: 方法重载时,具体调用哪个方法,是由传入参数的静态类型来决定的,而不是由参数的实际类型来决定

Wechat applet: Star Trek spaceship ticket production and generation

数字藏品——新的投资机遇

Lottery DDD code

Heimdall Database Proxy横向扩展提高20倍

The construction of digital factory can be divided into three aspects

Genetic engineering of AI art? Use # artbreeder to change any shape of the image

Raspberry pie assert preliminary exercise

Real MySQL interview question (30) -- shell real estate order analysis
随机推荐
数字藏品火热背后需要强大的技术团队支持 北方技术团队
【数据库备份】通过定时任务完成MySQL数据库的备份
Real MySQL interview questions (XXVII) -- Classification of users by RFM analysis method
【斯坦福计网CS144项目】Lab2: TCPReceiver
[Stanford Jiwang cs144 project] lab2: tcpreceiver
Jvm: when a method is overloaded, the specific method to call is determined by the static type of the incoming parameter rather than the actual type of the parameter
True MySQL interview question (XXII) -- condition screening and grouping screening after table connection
Ansible 使用普通用户管理被控端
Oracle异常
Digital collections - new investment opportunities
Adnroid activity截屏 保存显示到相册 View显示图片 动画消失
iNFTnews | 加密之家从宇宙寄来的明信片,你会收到哪一张?
常用的无线充发射IC芯片
True MySQL interview question (21) - Finance - overdue loan
What does the English letter PC mean? What does the Internet PC mean
【owt】owt-client-native-p2p-e2e-test vs2017构建 6:修改脚本自动生成vs工程
知识点滴 - 折叠锻打和大马士革钢
Wechat applet: Puzzle toolbox
node中操作mongoDB
英集芯ip6806无线充电方案5W过Qi认证外围精简14颗器件