Здравейте,
Опитвам се да реша следната задача:
Signal from Space
One day a signal from space was registered. Scientists managed to record the signal as a sequence of N
symbols. It turned out that due to a technical difficulty some symbols have been repeated. Help the scientists by writing a program which removes consecutive repetitions of symbols, decoding the message.
Input
Input data is read from the standard input
- On the only input line, a message is given
Output
Print to the standard output
- Print the decoded message
Constraints
- The length of the message will be no more than
10000
symbols - Message consists of digits and Latin letters (upper and lower case)
Sample tests
Input
Hello
Output
Helo
Input
hoboobbo422222Aaao
Output
hobobo42Aao
Преработих кода си няколко пъти докато стигна до това положение: import java.util.Scanner;public class SignalFromSpace { public static v - Pastebin.com
Въпреки това резултатът ми излиза верен на 55%. Може ли някой да подаде една ръка, тъй като сама не успявам да открия грешката си?
Благодаря предварително!