FastPrepExcel Sheet Column Title

Excel Sheet Column Title

UiPath logoUiPath● EasyFULLTIMEPHONE SCREEN

Problem statement

Given a positive integer columnNumber, return its corresponding Excel-style column title.

The titles use uppercase letters with the sequence A through Z, followed by AA, AB, and so on.

Function

convertToTitle(columnNumber: int) → String

Examples

Example 1

columnNumber = 1return = "A"

Column 1 maps to the first letter, A.

Example 2

columnNumber = 28return = "AB"

After Z, the sequence continues with AA and then AB.

Example 3

columnNumber = 701return = "ZY"

The bijective base-26 digits are Z and Y.

Constraints

  • 1 <= columnNumber <= 2^31 - 1

More UiPath problems

See UiPath hiring insights
Saved
class Solution {
    public String convertToTitle(int columnNumber) {
        // write your code here
    }
}
Checking account…