<gouthampradhan>array_SortColors_1.java
public void sortColors(int[] nums) {
    int s = nums[0]; 
    nums[0] = 1; 
    int l = 0, r = 0; 
    for (int i = 1; i < nums.length; i++) {
      switch (nums[i]) {
        case 0:
          nums[l] = 0;
          nums[r + 1] = 1;
          if (r + 1 != i) {
            nums[i] = 2;
          }
          l++;
          r++;
          break;
        case 1:
          nums[r + 1] = 1;
          if (r + 1 != i) {
            nums[i] = 2;
          }
          r++;
          break;
      }
    }
    if (s == 0) nums[l] = 0;
    else if (s == 2) nums[r] = 2;
  }
public void var_0 ( int [ ] var_1 ) {
  int var_3 = var_1 [ 0 ] ;
  var_1 [ 0 ] = 1 ;
  int var_5 = 0 , var_6 = 0 ;
  for ( int var_7 = 1 ;
  var_7 < var_1 . length ;
  var_7 ++ ) {
    switch ( var_1 [ var_7 ] ) {
      case 0 : var_1 [ var_5 ] = 0 ;
      var_1 [ var_6 + 1 ] = 1 ;
      if ( var_6 + 1 != var_7 ) {
        var_1 [ var_7 ] = 2 ;
      }
      var_5 ++ ;
      var_6 ++ ;
      break ;
      case 1 : var_1 [ var_6 + 1 ] = 1 ;
      if ( var_6 + 1 != var_7 ) {
        var_1 [ var_7 ] = 2 ;
      }
      var_6 ++ ;
      break ;
    }
  }
  if ( var_3 == 0 ) var_1 [ var_5 ] = 0 ;
  else if ( var_3 == 2 ) var_1 [ var_6 ] = 2 ;
}
