[BOJ 7120] String
View as PDF
Submit solution
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text
Points:
1
Time limit:
1.0s
Memory limit:
128M
Problem type
Allowed languages
It sometimes happens that a button on the computer keyboard sticks and then in the printed text there are more than one identical letters. For example, the word "piano" can change into "ppppppiaanooooo".</p>
Your task is to write a program that corrects these errors: finds all the places within the given string, where identical letters follow each other and replaces them with one letter- that is, erases all the other identical letters and adds the remaining part of the string onto the end of the one remaining letter.
입력 형식
The first line of the input is a string containing only lowercase latin letters. The string is at most 250 symbols in length.
출력 형식
Output the corrected string in the first line of the output.
예제 입력
ppppppiaanooooo
예제 출력
piano
Comments