Column Title to Number

Excel columns are labeled with letters instead of plain numbers: A, B, Z, then AA, AB, and so on. Given a column title column_title, return its position number. Treat the title like a special letter-based number system.

Примеры

Ввод
"A"
Вывод
1
Ввод
"AB"
Вывод
28
Ввод
"ZY"
Вывод
701

Нужно реализовать

def title_to_number(column_title: str) -> int:

Теги

stringsmath
PostgreSQLv16

Εδώ θα εμφανιστεί το αποτέλεσμα εκτέλεσης του κώδικα

Visible tests
1
Input
"A"
Expected1
2
Input
"AB"
Expected28
3
Input
"ZY"
Expected701
4
Input
"Z"
Expected26
5
Input
"AA"
Expected27
6
Input
""
Expected0
Focus radio
Paused · SomaFM · Fluid