Description

Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet. For example, 1=A, 2=B, 26=Z, 27=AA, 28=AB, etc.

Examples

Input:columnNumber = 28
Output:"AB"
Explanation:

28 → AB.

Input:columnNumber = 1
Output:"A"
Explanation:

Column 1 corresponds to the letter 'A'.

Input:columnNumber = 52
Output:"AZ"
Explanation:

52 corresponds to the column title "AZ". After Z (26), the sequence continues with AA (27), AB (28), and so on until AZ (52).

Constraints

  • 1 ≤ columnNumber ≤ 2³¹ - 1

Ready to solve this problem?

Practice solo or challenge other developers in a real-time coding battle!