<awangdev>Reverse Words in a String II_2.java
public void reverseWords(char[] s) {
        if (s == null || s.length == 0) {
            return;
        }
        int len = s.length;
        for (int i = 0; i < len / 2; i++) {
            char temp = s[i];
            s[i] = s[len - 1 - i];
            s[len - 1 - i] = temp;
        }

        int start = 0;
        int mid = 0;
        int end = 0;
        for (int i = 0; i < len; i++) {
            if (s[i] == ' ') {
                mid = start + (end - start) / 2;
                for (int j = start; j <= mid; j++) {
                    char temp = s[j];
                    s[j] = s[end - (j - start)];
                    s[end - (j - start)] = temp;
                }
                start = i + 1;
            } else {
                end = i;
            }
        }

        mid = start + (end - start) / 2;
        for (int j = start; j <= mid; j++) {
            char temp = s[j];
            s[j] = s[end - (j - start)];
            s[end - (j - start)] = temp;
        }
        
    }
public void var_0 ( char [ ] var_1 ) {
  if ( var_1 == null || var_1 . length == 0 ) {
    return ;
  }
  int var_5 = var_1 . length ;
  for ( int var_6 = 0 ;
  var_6 < var_5 / 2 ;
  var_6 ++ ) {
    char var_8 = var_1 [ var_6 ] ;
    var_1 [ var_6 ] = var_1 [ var_5 - 1 - var_6 ] ;
    var_1 [ var_5 - 1 - var_6 ] = var_8 ;
  }
  int var_10 = 0 ;
  int var_11 = 0 ;
  int var_12 = 0 ;
  for ( int var_6 = 0 ;
  var_6 < var_5 ;
  var_6 ++ ) {
    if ( var_1 [ var_6 ] == ' ' ) {
      var_11 = var_10 + ( var_12 - var_10 ) / 2 ;
      for ( int var_14 = var_10 ;
      var_14 <= var_11 ;
      var_14 ++ ) {
        char var_8 = var_1 [ var_14 ] ;
        var_1 [ var_14 ] = var_1 [ var_12 - ( var_14 - var_10 ) ] ;
        var_1 [ var_12 - ( var_14 - var_10 ) ] = var_8 ;
      }
      var_10 = var_6 + 1 ;
    }
    else {
      var_12 = var_6 ;
    }
  }
  var_11 = var_10 + ( var_12 - var_10 ) / 2 ;
  for ( int var_14 = var_10 ;
  var_14 <= var_11 ;
  var_14 ++ ) {
    char var_8 = var_1 [ var_14 ] ;
    var_1 [ var_14 ] = var_1 [ var_12 - ( var_14 - var_10 ) ] ;
    var_1 [ var_12 - ( var_14 - var_10 ) ] = var_8 ;
  }
}
