Trains the technique from
LeetCode 171Excel Sheet Column NumberThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
Shelves are labelled A, B, on to Z, then AA, AB and onwards, so the labels run through every string of uppercase letters, shorter labels first and alphabetically within a length.
Return the position of the shelf labelled label, counting from 1.
Example 1
The last of the single-letter labels sits at position 26.
Example 2
After the twenty-six single letters come the two-letter labels, and this is the first of them.
Example 3
Reading the three letters as a base twenty-six number with the first letter worth one gives 16900.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def title_to_number(label: str) -> int:public int titleToNumber(String label)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.