subject

Assume that someone dictates you a sequence of numbers and you need to write it down. for brevity, he dictates it as follows: first says the number of consecutive identical numbers and then says the number itself. e. g. the sequence 1 1 3 3 3 2 2 2 2 14 14 14 11 11 11 2 will be dictated as "two one, three three, four twos, three fourteens, three elevens, one two", so you will write down the sequence 2 1 3 3 4 2 3 14 3 11 1 2. the challenge is to write the program which compresses the given sequence using this approach. input: your program should read lines from standard input. each line is a sequence of l integers, where each integer is n, separated by a whitespace. n is in range [0, 99]. l is in range [1, 400]. output: for each test case, produce a single line of output containing a compressed sequence of numbers separated by a single space char.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:30
The qwerty keyboard is the most common layout of keys on a keyboard
Answers: 3
question
Computers and Technology, 23.06.2019 00:00
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
When is a chart legend used a. all the time b. whenever you are comparing data that is the same c. whenever you are comparing multiple sets of data d. only for hand-drawn charts
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
List 3 items that were on kens resume that should have been excluded
Answers: 1
You know the right answer?
Assume that someone dictates you a sequence of numbers and you need to write it down. for brevity, h...
Questions
Questions on the website: 13722363