当前位置:网站首页>20220602数学:Excel表列序号
20220602数学:Excel表列序号
2022-07-03 09:20:00 【丿SeeYouAgain】
题目描述:给你一个字符串 columnTitle
,表示 Excel 表格中的列名称。返回 该列名称对应的列序号 。
编码实现:
public int titleToNumber(String columnTitle) {
Long result=0L;
if (null == columnTitle){
return result.intValue();
}
char[] chars = columnTitle.toCharArray();
for(int i=0;i<chars.length;i++)
{
result = (result+chars[i]-'A'+1) * 26;
}
result = result / 26;
return result.intValue();
}
边栏推荐
- Liquid crystal display
- 2021-10-28
- Drive and control program of Dianchuan charging board for charging pile design
- Circular queue related design and implementation reference 1
- Pycharm cannot import custom package
- LeetCode - 5 最长回文子串
- When the reference is assigned to auto
- Opencv feature extraction sift
- Of course, the most widely used 8-bit single chip microcomputer is also the single chip microcomputer that beginners are most easy to learn
- Pymssql controls SQL for Chinese queries
猜你喜欢
Swing transformer details-2
Yocto technology sharing phase IV: customize and add software package support
yocto 技术分享第四期:自定义增加软件包支持
One click generate traffic password (exaggerated advertisement title)
Gpiof6, 7, 8 configuration
Basic knowledge of communication interface
QT is a method of batch modifying the style of a certain type of control after naming the control
使用密钥对的形式连接阿里云服务器
LeetCode - 1172 餐盘栈 (设计 - List + 小顶堆 + 栈))
Opencv image rotation
随机推荐
Opencv gray histogram, histogram specification
Qcombox style settings
Open Euler Kernel Technology Sharing - Issue 1 - kdump Basic Principles, use and Case Introduction
LeetCode - 508. 出现次数最多的子树元素和 (二叉树的遍历)
Pycharm cannot import custom package
Retinaface: single stage dense face localization in the wild
Connect Alibaba cloud servers in the form of key pairs
Mobile phones are a kind of MCU, but the hardware it uses is not 51 chip
1. Finite Markov Decision Process
CV learning notes - edge extraction
My 4G smart charging pile gateway design and development related articles
Serial communication based on 51 single chip microcomputer
Circular queue related design and implementation reference 1
Openeuler kernel technology sharing - Issue 1 - kdump basic principle, use and case introduction
CV learning notes - deep learning
Stm32f407 key interrupt
Opencv notes 20 PCA
LeetCode 面试题 17.20. 连续中值(大顶堆+小顶堆)
LeetCode - 706 设计哈希映射(设计) *
My notes on intelligent charging pile development (II): overview of system hardware circuit design