Excel Sheet | Part - 2
Submissions: 212   Accuracy:

62.23%

  Difficulty: Easy   Marks: 2
Associated Course(s):   Amazon SDE Test Series

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.

User Task:
Complete the function ExcelColumnNumber() which taked a string as input and returns an integer.

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

Example:
Input
2
A
AA
Output
1
27

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

Contributor: Eesha Goyal
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.