Can anybody help me with this task? I dont understand I get [1,1], but not [1,2] array???

' ' '

class Solution {

public int removeDuplicates(int[] nums) {

int len = nums.length;

int i = 0;

while(i + 1 <= len){

if(nums[i] == nums[i + 1]){

nums[i] = nums[i + 1];

len--;

}

```
i++;
}
return len;
}
```

}

' ' '