Skip to content

Instantly share code, notes, and snippets.

@xzhang311
Created June 18, 2016 20:23
class Solution {
public:
string convertToTitle(int n) {
string res;
while(n!=0){
n=n-1;
res = string(1, (n%26 +'A')) + res;
n = n/26;
}
return res;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment