Excel column titles are a base-26 system: A = 1, B = 2, … Z = 26, AA = 27.
A
B
Z
AA
Given a column title s, return its column number.
s
s = "A"
1
s = "AB"
28
Why
1 * 26 + 2
1 <= s.length <= 7 `s` consists of uppercase English letters only.
Topics
Implement titleToNumber in the editor and return the answer — printing it is never graded.
titleToNumber
Problem 32 of 1146 in the arena