 All Problems
Excel Sheet Column Number
easy
math
string
facebook
microsoft

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, ...

Example 1:

Input: columnTitle = "AB"
Output: 28

Example 2:

Input: columnTitle = "ZY"
Output: 701

Constraints:

  • 1 <= columnTitle.length <= 7
Run to check your code against the sample cases, or submit to run every case