#C5430. Remove Consecutive Duplicates

    ID: 49079 Type: Default 1000ms 256MiB

Remove Consecutive Duplicates

Remove Consecutive Duplicates

Given a string ( s ) containing only lowercase English letters, remove all consecutive duplicate characters. In other words, if a character appears consecutively in the string, only the first occurrence should be kept.

For example, given the input string "aaabccddddde", the resulting string will be "abcde".

inputFormat

The input is provided via standard input (stdin) as a single line. It contains a string ( s ) consisting of only lowercase English letters. The string may be empty.

outputFormat

Output a single line to standard output (stdout) representing the resulting string after all consecutive duplicate characters have been removed.## sample

aaabccddddde
abcde