for(int i = 0; i< len - 2;i++){ // remmeber to end when we were at the 3rd last element
//skip duplicate here
if(i!=0 && numbers[i] == numbers[i-1]){
continue;
.
.
.
while (...) {
...
//and here
while(left<right&&numbers[left] == numbers[left-1]){
left++;
}
//and here
while(left<right&&numbers[right] == numbers[right+1]){
right--;
}
}
}