Description
Given a string columnTitle that represents the column title as appears in an Excel sheet, return its corresponding column number. A -> 1, B -> 2, ... Z -> 26, AA -> 27, AB -> 28, etc.
Examples
Input:
columnTitle = "A"Output:
1Explanation:
A is the 1st column.
Input:
columnTitle = "AB"Output:
28Explanation:
A=1, B=2. 1*26 + 2 = 28.
Input:
columnTitle = "ZY"Output:
701Explanation:
Z=26, Y=25. 26*26 + 25 = 701.
Constraints
- •
1 ≤ columnTitle.length ≤ 7 - •
columnTitle consists only of uppercase English letters.