Bloomberg Interview Question

Remove consecutive duplicates in a string inplace and less than O(n)