
Excel Sheet Column Title (easy)
Problem Statement
Given a positive integer n, return the string referring to the corresponding column title in the Excel sheet.
Excel titles are composed of uppercase letters, where "A" denotes the first column, "B" the second, up to "Z" for the 26th column. After "Z", the titles continue with two-letter combinations starting with "AA", "AB", and so on.
Examples
-
Example 1
- Input:
700 - Expected Output: "ZX"
- Justification: The number 700 corresponds to the column title "ZX" in Excel, where "Z" is the 26th letter, and "X" follows in the sequence, indicating 26*26 + 24.
- Input:
-
Example 2
- Input:
52 - Expected Output: "AZ"
- Justification: The number 52 translates to "AZ", where "A" denotes the first cycle of 26, and "Z" is the 26th letter.
- Input:
-
Example 3
- Input:
705 - Expected Output: "AAC"
- Justification: For the number 705, the column title is "AAC", which represents 26*26 + 1*26 + 3, indicating two cycles through the alphabet plus three letters into the next cycle.
- Input:
Try it yourself
Try solving this question here:
Python3
Python3
. . . .
.....
.....
.....
Unlock this and all other premium problems.
No code editor for this lesson
This lesson focuses on concepts and theory