标签:solution tostring div blog tle rtt col res column
class Solution { public String convertToTitle(int n) { if (n <= 0) { return ""; } StringBuilder result = new StringBuilder(); while (n-- > 0) { result.insert(0, (char)(‘A‘ + n % 26)); n /= 26; } return result.toString(); } }
LeetCode 168: Excel Sheet Column Title
标签:solution tostring div blog tle rtt col res column
原文地址:http://www.cnblogs.com/shuashuashua/p/7469953.html