Solution 1 - Base-26 Conversion (Iterative)
Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet (A=1, B=2, ..., Z=26, AA=27, AB=28, ...). This is essentially a 1-indexed base-26 number system. We repeatedly subtract 1 from columnNumber to convert it to 0-indexed, then take the remainder when divided by 26 to find the current character, and divide by 26 to move to the next digit. Characters are built from right to left, so we reverse at the end.
Solution 2 - Recursive Approach
Same base-26 logic but implemented recursively. The base case is when columnNumber is 0, returning an empty string. Each recursive call processes one character by subtracting 1, finding the current letter via modulo, and recursing on the quotient. The recursion naturally builds the string from left to right.