leetcode:数学:Excel Sheet Column Numbe(171)

原创 2016年08月30日 15:15:05

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 

class Solution {
public:
    int titleToNumber(string s) {
        int col = 0;
        for (char i : s)
            col = col * 26 + (i - 'A' + 1);
        return col;
    }
};
版权声明:本文为博主原创文章,未经博主允许不得转载。

Leetcode 171. Excel Sheet Column Number

Related to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return...

[LeetCode][171][Excel Sheet Column Number]

题目链接:https://leetcode.com/problems/excel-sheet-column-number/ 题目描述: Given a column title a...

LeetCode笔记:171. Excel Sheet Column Number

模仿处理excel中的列

Leetcode_171_Excel Sheet Column Number

本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/42290079 Given a column title ...

<LeetCode OJ> 171 / 168 Excel Sheet Column Number & Title

171. Excel Sheet Column Number My Submissions Question Total Accepted: 58671 Total Submissions: ...

LeetCode之路:171. Excel Sheet Column Number

LeetCode之路:171. Excel Sheet Column Number 一、引言这道题相对来说比较简单,但是背后涉及到的东西确实挺有意思的: 我才知道 Excel 的列的表示是用的类似...

LeetCodeOJ_171_Excel Sheet Column Number

Given a column title as appear in an Excel sheet, return its corresponding column number.

171. Excel Sheet Column Number\172. Factorial Trailing Zeroes\134. Gas Station\135. Candy

Excel Sheet Column Number 题目描述 代码实现 Factorial Trailing Zeroes 题目描述 代码实现 Gas Station 题目描述 代码实现 Candy ...

[LeetCode]--168. Excel Sheet Column Title

Given a positive integer, return its corresponding column title as appear in an Excel sheet.For exam...

[C++]LeetCode: 57 Excel Sheet Column Title

题目: Given a positive integer, return its corresponding column title as appear in an Excel sheet. F...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:leetcode:数学:Excel Sheet Column Numbe(171)
举报原因:
原因补充:

(最多只允许输入30个字)