1 Line Java Solution


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

Log in to reply
 

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