Excel Sheet Column Number
Given a string columnTitle that represents the column title as it appears in an Excel sheet, return its corresponding column number.
Excel column titles work like a base-26 number system using letters:
Arepresents1Brepresents2- ...
Zrepresents26AArepresents27ABrepresents28
Return the integer value represented by columnTitle.
Example 1
Input
columnTitle = "A"Output
1The column title
A corresponds to column number 1.Example 2
Input
columnTitle = "AB"Output
28The title
AB represents 1 group of 26 plus 2, so its value is 28.Constraints
- 1 <= columnTitle.length <= 7
- columnTitle consists only of uppercase English letters
- columnTitle is in the range ["A", "FXSHRXW"]