The input message consists of ASCII characters
The encoded output message consists of blocks of 0
A block is separated from another block by a space
Two consecutive blocks are used to produce a series of same value bits (only 1s or 0s):
After the ACSII character(s) have been converted to binary, go through the string:
If its a 1: add 0 0
*The last character multiplied by how many "1"s in the string consecutively after the first 1 found
Else If its a 0: add 00 0
*The last character multiplied by how many "0"s in the string consecutively after the first 0 found
Input:
The message consisting of N ASCII characters (without carriage return)
Output:
The encoded message
Example
Input
C
Output
0 0 00 0000 0 00
More details and a better explanation can be found here: https://github.com/GlenDC/Codingame/blob/master/descriptions/chuck_norris.md
Remember! This is code-golf, shortest code wins!