One line in Java


  • 5
    C
    public String convertToTitle(int n) {
        return n<=0?"":convertToTitle((n-1)/26)+(char)('A'+(n-1)%26);
    }

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.