<qiyuangong>443_String_Compression_1.java
public int compress(char[] chars) {
        int anchor = 0, write = 0;
        for (int read = 0; read < chars.length; read++) {
            if (read + 1 == chars.length || chars[read + 1] != chars[read]) {
                chars[write++] = chars[anchor];
                if (read > anchor) {
                    for (char c: ("" + (read - anchor + 1)).toCharArray()) {
                        chars[write++] = c;
                    }
                }
                anchor = read + 1;
            }
        }
        return write;
    }
public int sample_funcname ( char [ ] var_0 ) {
  int var_2 = 0 , var_3 = 0 ;
  for ( int var_4 = 0 ;
  var_4 < var_0 . length ;
  var_4 ++ ) {
    if ( var_4 + 1 == var_0 . length || var_0 [ var_4 + 1 ] != var_0 [ var_4 ] ) {
      var_0 [ var_3 ++ ] = var_0 [ var_2 ] ;
      if ( var_4 > var_2 ) {
        for ( char var_9 : ( "" + ( var_4 - var_2 + 1 ) ) . toCharArray ( ) ) {
          var_0 [ var_3 ++ ] = var_9 ;
        }
      }
      var_2 = var_4 + 1 ;
    }
  }
  return var_3 ;
}
