java Solution


  • 0
    3
    public String convertToTitle(int n) {
    
    		String result = "";
    		while (n != 0) {
    			char c = (char) (--n % 26 + 'A');
    			result = c + result;
    			n = n / 26;
    		}
    		return result;
    	}
    

Log in to reply
 

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