question 59 Strings & Text · hard
Column number to letters
A report generator knows a value belongs in column 28 and has to write it to spreadsheet column AB. Columns run A–Z (1–26), then AA–AZ (27–52), and so on up to XFD (16384). Turn number into its column letters. There is no zero digit in this system, which is why ordinary base-26 conversion gives wrong answers at the edges: subtract 1 before taking each remainder.
Input
number, a whole number from 1 to 16384Printsthe column letters
Examples
28 → AB; 1 → A; 26 → ZExpected output1 line
- 1AB