当前位置:网站首页>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();
}边栏推荐
- LeetCode - 715. Range 模块(TreeSet) *****
- Octave instructions
- CV learning notes convolutional neural network
- Leetcode interview question 17.20 Continuous median (large top pile + small top pile)
- LeetCode - 508. Sum of subtree elements with the most occurrences (traversal of binary tree)
- LeetCode - 460 LFU 缓存(设计 - 哈希表+双向链表 哈希表+平衡二叉树(TreeSet))*
- Swing transformer details-1
- Sending and interrupt receiving of STM32 serial port
- CV learning notes ransca & image similarity comparison hash
- is_ power_ of_ 2 judge whether it is a multiple of 2
猜你喜欢

QT is a method of batch modifying the style of a certain type of control after naming the control

CV learning notes - image filter

I think all friends should know that the basic law of learning is: from easy to difficult

51 MCU tmod and timer configuration

2021-10-27

使用密钥对的形式连接阿里云服务器

Gpiof6, 7, 8 configuration

Interruption system of 51 single chip microcomputer

LeetCode - 900. RLE 迭代器

Leetcode bit operation
随机推荐
03 fastjason solves circular references
4G module at command communication package interface designed by charging pile
CV learning notes - scale invariant feature transformation (SIFT)
Adaptiveavgpool1d internal implementation
Connect Alibaba cloud servers in the form of key pairs
QT detection card reader analog keyboard input
Opencv notes 20 PCA
01仿B站项目业务架构
CV learning notes - image filter
Design of charging pile mqtt transplantation based on 4G EC20 module
LeetCode - 1670 設計前中後隊列(設計 - 兩個雙端隊列)
CV learning notes - clustering
Toolbutton property settings
Gif image analysis drawing RGB to YUV table lookup method to reduce CPU occupancy
SCM is now overwhelming, a wide variety, so that developers are overwhelmed
Mobile phones are a kind of MCU, but the hardware it uses is not 51 chip
2. Elment UI date selector formatting problem
Leetcode 300 longest ascending subsequence
03 FastJson 解决循环引用
My notes on the development of intelligent charging pile (III): overview of the overall design of the system software