Problem statement:
Given an array of sorted numbers, remove all duplicates from it. You should not use any extra space ; after removing the duplicates in-place return the length of the subarray that has no duplicate in it.
In the solution, elements are not removed from the array, they just shifted to the end of the array. I think, either the problem statement should be different (e.g. “…shift all duplicates to the end…”) or the solution should be modified to actually remove duplicates.