FunctionRacerProblemsRace

Excel Column Number

EasyMathPython, JavaScript, TypeScript, Java, C++

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

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Math problems