Excel Sheet | Part - 2
Submissions: 3606   Accuracy:

59.77%

  Difficulty: Easy   Marks: 2

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.

Input:
The first line contains an integer T, depicting total number of test cases. T testcases follow. Each testcase contains a single line of input containing string S.

Output:
For each testcase, in a new line, print the column number.

Constraints:
1 ≤ T ≤ 100
1 ≤ |S| <=7

Example:
Input
2
A
AA
Output
1
27

** For More Input/Output Examples Use 'Expected Output' option **

Author: Shubham Joshi 1


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.