Easy · Math

Base 26 encoding

Given a positive integer n, return its Excel column title (1 → "A", 26 → "Z", 27 → "AA", 28 → "AB").

Examples

Example 1

n = 28 → AB

Output: "AB"

Example 2

n = 701 → ZY

Output: "ZY"

Rebuild it in the studio

Open every published interview problem, solution, scene, and memory room free, with no account.

More Math problems