comefrom: <gouthampradhan>string_TextJustification_1.java
code: public List<String> fullJustify(String[] words, int L) {
      int wCount = 0, charCount = 0;
      List<String> line = new ArrayList<>();
      List<String> result = new ArrayList<>();
      StringBuilder sb = new StringBuilder();
      for (int i = 0, l = words.length; i < l; i++) {
        String next = words[i];
        if ((L - (charCount + wCount)) >= next.length()) {
          line.add(next);
          charCount += next.length();
          wCount++;
        } else {
          sb.append(line.get(0));
          StringBuilder space = new StringBuilder();
          if (line.size() > 1) {
            int spaceCount = (L - charCount) / (wCount - 1);
            int remaining = (L - charCount) % (wCount - 1);
            for (int j = 0; j < spaceCount; j++) space.append(' ');
            for (int k = 1, kl = line.size(); k < kl; k++) {
              sb.append(space);
              if (remaining > 0) {
                sb.append(' ');
                --remaining;
              }
              sb.append(line.get(k));
            }
          } else {
            int balance = L - (charCount + (wCount - 1));
            for (int j = 0; j < balance; j++) sb.append(' ');
          }
          result.add(sb.toString());
          sb = new StringBuilder();
          line.clear();
          line.add(next);
          charCount = next.length();
          wCount = 1;
        }
      }
      if (!line.isEmpty()) {
        sb.append(line.get(0));
        for (int i = 1, l = line.size(); i < l; i++) {
          sb.append(' ');
          sb.append(line.get(i));
        }
      }
      int balance = L - (charCount + (wCount - 1));
      for (int i = 0; i < balance; i++) sb.append(' ');
      result.add(sb.toString());
      return result;
    }
masked: public List < String > var_0 ( String [ ] var_1 , int var_2 ) {
    int var_3 = 0 , var_4 = 0 ;
    List < String > var_5 = new ArrayList < > ( ) ;
    List < String > var_6 = new ArrayList < > ( ) ;
    StringBuilder var_7 = new StringBuilder ( ) ;
    for ( int var_8 = 0 , var_9 = var_1 . length ;
    var_8 < var_9 ;
    var_8 ++ ) {
      String var_10 = var_1 [ var_8 ] ;
      if ( ( var_2 - ( var_4 + var_3 ) ) >= var_10 . length ( ) ) {
        var_5 . add ( var_10 ) ;
        var_4 += var_10 . length ( ) ;
        var_3 ++ ;
      }
      else {
        var_7 . append ( var_5 . get ( 0 ) ) ;
        StringBuilder var_11 = new StringBuilder ( ) ;
        if ( var_5 . size ( ) > 1 ) {
          int var_12 = ( var_2 - var_4 ) / ( var_3 - 1 ) ;
          int var_13 = ( var_2 - var_4 ) % ( var_3 - 1 ) ;
          for ( int var_14 = 0 ;
          var_14 < var_12 ;
          var_14 ++ ) var_11 . append ( ' ' ) ;
          for ( int var_15 = 1 , var_16 = var_5 . size ( ) ;
          var_15 < var_16 ;
          var_15 ++ ) {
            var_7 . append ( var_11 ) ;
            if ( var_13 > 0 ) {
              var_7 . append ( ' ' ) ;
              -- var_13 ;
            }
            var_7 . append ( var_5 . get ( var_15 ) ) ;
          }
        }
        else {
          int var_17 = var_2 - ( var_4 + ( var_3 - 1 ) ) ;
          for ( int var_14 = 0 ;
          var_14 < var_17 ;
          var_14 ++ ) var_7 . append ( ' ' ) ;
        }
        var_6 . add ( var_7 . toString ( ) ) ;
        var_7 = new StringBuilder ( ) ;
        var_5 . clear ( ) ;
        var_5 . add ( var_10 ) ;
        var_4 = var_10 . length ( ) ;
        var_3 = 1 ;
      }
    }
    if ( ! var_5 . isEmpty ( ) ) {
      var_7 . append ( var_5 . get ( 0 ) ) ;
      for ( int var_8 = 1 , var_9 = var_5 . size ( ) ;
      var_8 < var_9 ;
      var_8 ++ ) {
        var_7 . append ( ' ' ) ;
        var_7 . append ( var_5 . get ( var_8 ) ) ;
      }
    }
    int var_17 = var_2 - ( var_4 + ( var_3 - 1 ) ) ;
    for ( int var_8 = 0 ;
    var_8 < var_17 ;
    var_8 ++ ) var_7 . append ( ' ' ) ;
    var_6 . add ( var_7 . toString ( ) ) ;
    return var_6 ;
  }
  