#C13859. Remove Consecutive Duplicates
Remove Consecutive Duplicates
Remove Consecutive Duplicates
Your task is to implement a program that removes consecutive duplicates from a sequence of integers while preserving the original order.
For example, given the list \( [1, 2, 2, 3, 3, 3, 4, 3, 3, 1, 1] \), the answer should be \( [1, 2, 3, 4, 3, 1] \). Note that only consecutive duplicates are removed. If a number reoccurs after a different number, it should be retained.
You need to read the input from standard input (stdin) and output the result to standard output (stdout).
inputFormat
The input is provided on a single line via standard input. This line contains zero or more integers separated by single spaces. An empty line corresponds to an empty list.
outputFormat
Print the resulting list after removing consecutive duplicates as a sequence of integers separated by a single space on one line. If the resulting list is empty, output an empty line.
## sample1 2 2 3 3 3 4 3 3 1 1
1 2 3 4 3 1