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

Read every interview problem free. Ten rooms need no account. A token opens a problem in full — Pro never counts.

More Math problems