leetcode 168. Excel Sheet Column Title

    xiaoxiao2021-03-25  81

    public class Solution { public String convertToTitle(int n) { int temp = n; StringBuilder sbdr = new StringBuilder(); while (temp != 0) { sbdr.append((char)('A'+(temp-1)&)); temp -- ;// 少一个数 temp /= 26; } return sbdr.reverse().toString(); } }
    转载请注明原文地址: https://ju.6miu.com/read-14901.html

    最新回复(0)