当前位置:网站首页>Excel sheet column number for leetcode topic resolution
Excel sheet column number for leetcode topic resolution
2022-06-23 05:50:00 【ruochen】
Related to question Excel Sheet Column Title
Given a column title as appear in an Excel sheet, return its corresponding column number.
For example:
A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28
Hexadecimal
public int titleToNumber(String s) {
int n = 0;
int p = 1;
for (int i = s.length() - 1; i >= 0; i--) {
n += (s.charAt(i) - 'A' + 1) * p;
p *= 26;
}
return n;
}边栏推荐
- JS面试题----防抖函数
- Wechat applet: elderly blessing short video
- 工作积累-判断GPS是否打开
- Jsonfield annotation in fastjson
- Behind the hot digital collections, a strong technical team is needed to support the northern technical team
- ORB_SLAM2运行
- 云原生数据库是未来
- PAT 乙等 1023 组个最小数
- True MySQL interview question (24) -- row column exchange
- Visdom draws multiple dynamic loss curves
猜你喜欢

Yingjixin ip6806 wireless charging scheme 5W Qi certified peripheral simplified 14 devices

数字化工厂建设可划分为三个方面

Wechat applet: elderly blessing short video

Heimdall database proxy scale out 20 times

The digital collection market has just begun

True MySQL interview question (24) -- row column exchange

Heimdall Database Proxy横向扩展提高20倍

Leetcode 797: all possible paths

ArcTime 制作中英文字幕视频

The 510000 prize pool invites you to participate in the competition -- the second Alibaba cloud ECS cloudbuild developer competition is coming
随机推荐
PAT 乙等 1012 C语言
MDM data cleaning function development description
Skill self check | do you know these 6 skills if you want to be a test leader?
Wechat applet; AI intelligent dubbing assistant
APP SHA1获取程序 百度地图 高德地图获取SHA1值的简单程序
MySQL面试真题(二十六)——滴滴2020年笔试题
PAT 乙等 1017 C语言
[Stanford Jiwang cs144 project] lab2: tcpreceiver
PAT 乙等 1009 C语言
FS4059A与FS5080E充电芯片的区别
visdom画多条动态损失曲线
PAT 乙等 1026 程序运行时间
ORB_SLAM2运行
PAT 乙等 1024 科学记数法 C语言
Analysis on the problems and causes of digital transformation of manufacturing industry
高等数学(第七版)同济大学 习题1-8 个人解答
Kotlin android简单Activity跳转、handler和thread简单配合使用
51万奖池邀你参战——第二届阿里云ECS CloudBuild开发者大赛来袭
Genetic engineering of AI art? Use # artbreeder to change any shape of the image
True MySQL interview question (24) -- row column exchange