Array Remove Alternate Duplicate Characters LeetCode

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"
NOTE:
  • 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:

 

No comments:

Post a Comment