Share my solusion


  • 0
    I
      public static String convertToTitle(int n) {
    	StringBuilder str = new StringBuilder();
    	char A = 'A';
    	do {
    		n--;
    		str.insert(0, (char) (A + n % 26));
    		n/=26;
    	} while (n != 0);
    
    	return str.toString();
    }

Log in to reply
 

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