<gouthampradhan>two_pointers_RemoveDuplicatesII_1.java
public int removeDuplicates(int[] nums) {
    if (nums.length == 0) return 0;
    int j = 0;
    int count = 1;
    for (int i = 1; i < nums.length; i++) {
      if (nums[i - 1] == nums[i]) {
        count++;
      } else {
        count = 1;
      }
      if (count == 1 || count == 2) {
        j++;
        nums[j] = nums[i];
      }
    }
    return j + 1;
  }
public int sample_funcname ( int [ ] var_0 ) {
  if ( var_0 . length == 0 ) return 0 ;
  int var_3 = 0 ;
  int var_5 = 1 ;
  for ( int var_6 = 1 ;
  var_6 < var_0 . length ;
  var_6 ++ ) {
    if ( var_0 [ var_6 - 1 ] == var_0 [ var_6 ] ) {
      var_5 ++ ;
    }
    else {
      var_5 = 1 ;
    }
    if ( var_5 == 1 || var_5 == 2 ) {
      var_3 ++ ;
      var_0 [ var_3 ] = var_0 [ var_6 ] ;
    }
  }
  return var_3 + 1 ;
}
