X

DAYS

:

HOUR

:

MINS

:

SEC

Copied to Clipboard
Excel Sheet | Part - 2
Easy Accuracy: 62.55% Submissions: 2272 Points: 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.

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

We are replacing the old Disqus forum with the new Discussions section given below.
Click here to view old Disqus comments.


to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Excel Sheet | Part - 2

Output Window