<awangdev>168. Excel Sheet Column Title_1.java
public String convertToTitle(int n) {
        if (n <= 0) {
            return null;
        }
        
        StringBuilder sb = new StringBuilder();
        while (n > 0) {
            int remain = n % 26;
            n = n / 26;
            if (remain == 0) {
                sb.append("Z");
                n--;
            } else {
                sb.append((char)('A' + remain - 1));
            }
        }
        return sb.reverse().toString();
    }
public String var_0 ( int var_1 ) {
  if ( var_1 <= 0 ) {
    return null ;
  }
  StringBuilder var_5 = new StringBuilder ( ) ;
  while ( var_1 > 0 ) {
    int var_7 = var_1 % 26 ;
    var_1 = var_1 / 26 ;
    if ( var_7 == 0 ) {
      var_5 . append ( "Z" ) ;
      var_1 -- ;
    }
    else {
      var_5 . append ( ( char ) ( 'A' + var_7 - 1 ) ) ;
    }
  }
  return var_5 . reverse ( ) . toString ( ) ;
}
