String: remove duplicates in-place: O(n logn) and O(n) algorithms