Excel Column Number
Spreadsheet columns are named A, B, ..., Z, then AA, AB, ..., AZ, BA, ... and so on. Given a column name made of capital letters, return its column number (A is 1).
Example 1
columnTitle "AB"
returns 28
A is 1 and B is 2, so 26*1 + 2 = 28.
Example 2
columnTitle "Z"
returns 26
26.
Constraints
1 <= len(columnTitle) <= 7- Only capital letters A to Z
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.