comefrom: <gouthampradhan>string_ZigZagConversion_1.java
code: public String convert(String s, int numRows) {
      if (s == null || s.length() <= numRows || numRows == 1) return s;
      List<String> list = new ArrayList<>();
      char[] A = new char[numRows];
      int direction = 1; 
      int n = 1;
      A[0] = s.charAt(0);
      for (int j = 1; j < numRows; ) {
        if (n >= s.length()) break;
        A[j] = s.charAt(n++);
        if (j == numRows - 1) {
          list.add(String.valueOf(A));
          A = new char[numRows];
          Arrays.fill(A, ' ');
          direction = 0;
        } else if (j == 0) {
          list.add(String.valueOf(A));
          A = new char[numRows];
          Arrays.fill(A, ' ');
          direction = 1;
        }
        j = direction == 1 ? j + 1 : j - 1;
      }
      if (!String.valueOf(A).trim().isEmpty()) list.add(String.valueOf(A));
      char[] arr = new char[s.length()];
      int k = 0;
      for (int j = 0; j < numRows; j++) {
        for (String aList : list) {
          if (aList.charAt(j) != ' ') arr[k++] = aList.charAt(j);
        }
      }
      return new String(arr).trim();
    }
masked: public String var_0 ( String var_1 , int var_2 ) {
    if ( var_1 == null || var_1 . length ( ) <= var_2 || var_2 == 1 ) return var_1 ;
    List < String > var_3 = new ArrayList < > ( ) ;
    char [ ] var_4 = new char [ var_2 ] ;
    int var_5 = 1 ;
    int var_6 = 1 ;
    var_4 [ 0 ] = var_1 . charAt ( 0 ) ;
    for ( int var_7 = 1 ;
    var_7 < var_2 ;
    ) {
      if ( var_6 >= var_1 . length ( ) ) break ;
      var_4 [ var_7 ] = var_1 . charAt ( var_6 ++ ) ;
      if ( var_7 == var_2 - 1 ) {
        var_3 . add ( String . valueOf ( var_4 ) ) ;
        var_4 = new char [ var_2 ] ;
        Arrays . fill ( var_4 , ' ' ) ;
        var_5 = 0 ;
      }
      else if ( var_7 == 0 ) {
        var_3 . add ( String . valueOf ( var_4 ) ) ;
        var_4 = new char [ var_2 ] ;
        Arrays . fill ( var_4 , ' ' ) ;
        var_5 = 1 ;
      }
      var_7 = var_5 == 1 ? var_7 + 1 : var_7 - 1 ;
    }
    if ( ! String . valueOf ( var_4 ) . trim ( ) . isEmpty ( ) ) var_3 . add ( String . valueOf ( var_4 ) ) ;
    char [ ] var_8 = new char [ var_1 . length ( ) ] ;
    int var_9 = 0 ;
    for ( int var_7 = 0 ;
    var_7 < var_2 ;
    var_7 ++ ) {
      for ( String var_10 : var_3 ) {
        if ( var_10 . charAt ( var_7 ) != ' ' ) var_8 [ var_9 ++ ] = var_10 . charAt ( var_7 ) ;
      }
    }
    return new String ( var_8 ) . trim ( ) ;
  }
  