#C4743. Remove Consecutive Duplicates
Remove Consecutive Duplicates
Remove Consecutive Duplicates
Given an input string \(S\), remove all consecutive duplicate characters. In other words, if a character is repeated consecutively, it should be replaced by a single instance of that character. For example, \(aabbcc\) becomes \(abc\) and \(aaabbbccc\) becomes \(abc\). The input will be provided via standard input (stdin) and your output should be sent to standard output (stdout).
inputFormat
A single line containing the string (S).
outputFormat
A single line containing the string after removing consecutive duplicate characters.## sample
aabbcc
abc