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
Log in om je inzendingsgeschiedenis te zien
InloggenLog in om de AI-mentor te gebruiken
InloggenVisible tests
1
Input
"A"Expected
12
Input
"AB"Expected
283
Input
"ZY"Expected
7014
Input
"Z"Expected
265
Input
"AA"Expected
276
Input
""Expected
0Focus radio
Paused · SomaFM · Fluid