Remove duplicate elements from a sorted array without allocating extra space.
Use insertion sort-style swapping to move duplicates to the end of the array. Somewhat similar to the previous problem.
Accepted on the first try. Here is the code:
| |
Remove duplicate elements from a sorted array without allocating extra space.
Use insertion sort-style swapping to move duplicates to the end of the array. Somewhat similar to the previous problem.
Accepted on the first try. Here is the code:
| |