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

Čia bus kodo vykdymo rezultatas

Tests12
Visible tests
Paslėptas testas 7
Paslėptas testas 8
Paslėptas testas 9
Paslėptas testas 10
Paslėptas testas 11
Paslėptas testas 12

They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.

Focus radio
Paused · SomaFM · Fluid