P19928 [GeeksforGeeks] Excel sheet part 21138
普及-
题目描述

Given a string S that represents column title of an Excel sheet, find the number that represents that column.
In excel A column is number 1, AA is 27 and so on.
Example 1:
Input:
S = A
Output: 1
Example 2:
Input:
S = AA
Output: 27
Your Task:
Complete the function ExcelColumnNumber() which takes a string as input and returns an integer.
Expected Time Complexity: O(|S|)
Expected Auxiliary Space: O(1)
Constraints:
1 ≤ |S| <=7

输入格式

见题面

输出格式

见题面

样例输入
S = A
样例输出
1