A spreadsheet-style data grid labels its columns A, B, ..., Z, AA, AB, ..., AZ, BA, ..., ZZ, AAA, and so on. Column 1 is A.
Write columnLabel(n) that returns the label of column n.
Input: n = 1 Output: "A"
The first column is A.
Input: n = 28 Output: "AB"
After Z (26) comes AA (27), then AB (28).
1 <= n <= 2^31 - 1Run tries your code on the examples. Submit runs every test, including hidden edge cases, and solves the problem when they all pass.
Ctrl + Enter runs, Ctrl + Shift + Enter submits (⌘ on a Mac).
I'm here to help with #654 Data Grid Column Label. I give hints, never the solution, so you get to solve it yourself. Ask for a hint, select code to ask about it, or press Ask Tuto why on a failing test.
Your first 3 answers need no account. for free to keep asking.