Problem: Excel Column Title
Problem Description: Given a positive integer A, return its corresponding column title as appear in an Excel sheet. Problem Constraints
1 <= A <= 1000000000
First and only argument is integer A.
Return a string, the answer to the problem.
Input 1: A = 1 Input 2: A = 28
Output 1: "A" Output 2: "AB"
Explanation 1: 1 -> A Explanation 2: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB
This question is just about the base conversion. Think about what would you have done if instead of excel (base-26) you were given a binary.
Time & Space Complexity:
Time Complexity: O(logN) -> base 26
Space Complexity: O(1)
Code in C++