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

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.