Excel Sheet Column Title

PHOTO EMBED

Fri Jun 24 2022 05:43:08 GMT+0000 (Coordinated Universal Time)

Saved by @Ranjan_kumar #c++

class Solution {
public:
    string convertToTitle(int n) {
        string result="";
        while(n){
            char c='A'+(n-1)%26;
            result=c+result;
            n=(n-1)/26;
        }
        return result;
    }
};
content_copyCOPY

https://leetcode.com/problems/excel-sheet-column-title/