Excel Column Number

You have been given a column title as appears in an Excel sheet, return its corresponding column number.

For example:
A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28 
...
Input Format
The only line of input contains a string S i.e. column title 
Constraints:
1 <= |S| <= 10
Input contains only uppercase English Alphabet letters

Time Limit : 1 sec
Output Format
The only line of output will print the column number corresponding to given column title 
CodingNinjas
author
2y

Approach :

The process is very much similar to binary to decimal conversion. In this case, the base of the given system is to be taken as 26. Also, in this system 1 is represented as ‘A’, 2 is represe...read more

CodingNinjas
author
2y
Base 26 Conversion

The process is very much similar to binary to decimal conversion. In this case, the base of the given system is to be taken as 26. Also, in this system 1 is represented as ‘A’, 2 is ...read more

Help your peers!
Add answer anonymously...
JPMorgan Chase & Co. Senior Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter