FunctionRacerProblemsRace

Excel Sheet Column Number

BeginnerMathPython, JavaScript, TypeScript, Java, C++

Spreadsheet columns are named A to Z, then AA, AB, ... AZ, BA, and so on. Given a column name columnTitle made of capital letters, return its number, where A is 1.

Example 1

columnTitle "A"
returns 1

The first column.

Example 2

columnTitle "AB"
returns 28

A is 26 + B is 2, giving 28.

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