I have a list of decimal digits:
4, 4, 4, 7, 7, 9, 9, 9, 9, 2, 2, 2, 4, 4
The list of decimal digits are known as items. We can form "chunks" from these items by grouping together identical and adjacent numbers. I want to assign each chunk a unique number, starting from 1, and increasing by 1 in the order the chunks appear in the original list. So, the output for the given example would look like this:
1, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5
A list of digits. (0-9) You may use your language built-ins to read this list however you want. Encoding: ASCII
A series of decimal numbers, separated by a delimiter. Your program must always use the same delimiter. The delimiter must be longer than 0 bits. Encoding: ASCII
Standard loopholes apply.
You may use your language built-ins to read this list however you want.. Does that mean we have to include a string to list converter in our submission? And are we allowed to output as a list? \$\endgroup\$