Excel Sheet Column Number
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
1 <= len(columnTitle) <= 5- Capital letters only
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More Math problems
- Handshake CountBeginner
- Harshad NumberBeginner
- Hex String to DecimalBeginner
- Highest Power of TwoBeginner
- Is PrimeBeginner
- Lattice Points in a CircleBeginner
- Leap YearBeginner
- Matches in a TournamentBeginner