Submit solution
Points:
10 (partial)
Time limit:
1.0s
Memory limit:
32M
Authors:
Problem type
Allowed languages
Python
Problem Statement
Given a string columnTitle that represents the column title as appears in an Excel sheet, return its corresponding column number.
For example:
A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28
...
Input Specification
The first line of the input gives the number of test cases, , test cases follow. Each test case consists of a line. The line contains the column title . The column title will contain only uppercase letters.
Limits
Memory limits: 32MB.
Time limits: 1 second.
(which means the result will in the range [1,12356630])
Test Set 1
Sample case.
Test Set 2
Test Set 3
Test Set 4
Output Specification
For each test case, output one line containing Case #x: y, where is the case number (starting from 1), and is the corresponding column number for the given column title .
Sample Input
2
A
AB
Sample Output
Case #1: 1
Case #2: 28
Hint
for-loop
chr/ord
positional numeral system
Comments