
Remove all consecutive duplicates from the string
Given a string S, remove all the consecutive duplicates and note that this problem is different from Recursively remove all adjacent duplicates. Here we keep one character and remove all subsequent same characters. For...