Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet.

For example:

A -&gt; 1
B -&gt; 2
C -&gt; 3
...
Z -&gt; 26
AA -&gt; 27
AB -&gt; 28 
...


&nbsp;
Example 1:

Input: columnNumber = 1
Output: "A"


Example 2:

Input: columnNumber = 28
Output: "AB"


Example 3:

Input: columnNumber = 701
Output: "ZY"


&nbsp;
Constraints:


	1 &lt;= columnNumber &lt;= 231 - 1


class Solution:
    def convertToTitle(self, num: int) -> str:
		# We make this lookup list, having A-Z in ascending order
        alpha = [chr(x) for x in range(ord("A"), ord("Z")+1)]     # range(65, 90+1) -> 91-65 = 26
        res = ""

        while num > 0:
            res += alpha[(num-1)%26]     # since 0 indexed list, num-1 % 26 gives the index of ch in alpha
            num = (num-1) // 26 
        return res[::-1]
class Solution {
    public String convertToTitle(int columnNumber) {
        String ans = "";
        while(columnNumber > 0){
            columnNumber--;
            ans = String.valueOf((char)('A' + (int)((26 + (long)columnNumber) % 26))) + ans;
            columnNumber /= 26;
        }
        return ans;
    }
}
class Solution {
public:
    string convertToTitle(int columnNumber) {
        string s = "";
        while(columnNumber){
            char c = (columnNumber-1)%26+65;
            s = c+s;
            columnNumber = (columnNumber-1)/26;
        }
        return s;
    }
};
/**
 * @param {number} columnNumber
 * @return {string}
 */
var convertToTitle = function(columnNumber) {
    let ans = "";
    while(columnNumber >0){
        let n = (--columnNumber) % 26;
        columnNumber = Math.floor(columnNumber/ 26);

        // console.log(String.fromCharCode(65+n),)
        ans+=String.fromCharCode(65 + n);

    }
    ans = ans.split("").reverse().join("")
    return ans
};
Excel Sheet Column Title