Problems > Spreadsheet Column Number

Spreadsheet Column Number

Difficulty: 1100 2000 ms 128 MB

math implementation

Inverse of column naming: given the name (A = 1, Z = 26, AA = 27, ...), print the column number.

Input: one line with the column name (uppercase).

Output: the column number.

Constraints:

  • 1 ≤ length ≤ 9

Sample Tests

Input 1
AB
Output 1
28
Input 2
ZY
Output 2
701

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.