Excel Sheet Column Number

Easy
Strings String Math

Given a column title (A=1, B=2, ..., Z=26, AA=27), return the corresponding number.

Constraints

1 ≤ length ≤ 7

Examples

Example 1:
Input: A
Output: 1
Example 2:
Input: AB
Output: 28
Example 3:
Input: ZY
Output: 701
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.