Spreadsheet columns are labelled A, B, ..., Z, AA, AB, .... Given a column title as a string of uppercase letters, return its corresponding 1-based column number.
So A -> 1, B -> 2, Z -> 26, AA -> 27, AB -> 28, and so on.
Input / output
columnTitle: string of uppercase letters A–ZExamples
columnTitle = "A" returns 1.columnTitle = "AB" returns 28.columnTitle = "ZY" returns 701.Constraints
1 <= columnTitle.length <= 7columnTitle contains only uppercase English letters.[1, 2^31 - 1].Follow-up
This is base-26 with digits 1..26 (there is no zero digit). Why does the absence of a zero digit make it bijective base-26 rather than ordinary base-26?