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)
Example: Input: "you got beautiful eyes"
Output: "you gtbeaiful es"
Allowed Time Complexity was O(n) and Space Complexity was O(1)
How this solution has o(n) time complexity?
ReplyDelete