26 Remove Duplicates From Sorted Array
Link to the problem: https://leetcode.com/problems/remove-duplicates-from-sorted-array
Solution 1
This was easier since I got this trick with the slow and quick pointers, where we essentially skip the elements we are not interested in and we swap (or better to say, keep) the elements we are interested in.
Similar to 27 Remove Element, but we work with duplicates.
Code C#
Complexity
- Time O(n)
- Space O(1)