Array Remove Alternate Duplicate Characters

Problem:

Remove Alternate Duplicate characters from a char array you have to do it in Place.Like keeping only the odd occurences of each character.
Example: Input: "you got beautiful eyes"
Output: "you gtbeaiful es"
Allowed Time Complexity was O(n) and Space Complexity was O(1)

This problem is popular in GeeksForGeeks, CareerCup, and other discussion forums - Link 1

Solution:

1 comment: