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:1
Explanation:

A is the 1st column.

Input:columnTitle = "AB"
Output:28
Explanation:

A=1, B=2. 1*26 + 2 = 28.

Input:columnTitle = "ZY"
Output:701
Explanation:

Z=26, Y=25. 26*26 + 25 = 701.

Constraints

  • 1 ≤ columnTitle.length ≤ 7
  • columnTitle consists only of uppercase English letters.

Ready to solve this problem?

Practice solo or challenge other developers in a real-time coding battle!