It has been determined that the coded strings are constructed of digit and non-digit characters. The digits always occur in matching pairs (ie both are 0s, both are 1s, ...) which together with all characters between them form a digit delimited string (DDS). A DDS may contain other DDSs. A DDS contains no digits other than those delimiting DDSs.
Only those characters contained in a DDS that contains no DDS substring are included in the final message. The digits are not included in the message. The characters of the message appear in the same order that they appear in the input.
For example, consider the string: xy8a7b4c8d7x7e8f4g7h8z. This string contains the DDSs: 7x7, 8d7x7e8, 4c8d7x7e8f4, 7b4c8d7x7e8f4g7, and 8a7b4c8d7x7e8f4g7h8. The single character x is the message from this string. All other characters are discarded since only 7x7 contains no other DDS as a substring.
Properly coded strings do not contain unmatched digits. You may assume that your input is a properly coded string. It has been observed (and you may assume) that the message will be no encoded string will be longer than 20 characters.
0 There are0no3troops on 35south7west5north57border and58coast8at sunrise.Sample 2:
0When in the 78course8 day to day grind 5 of 570playing 1 with3animal and 4human 4 sounds, we run into8events8 beyond our control31
There aretroops on northcoastSample 2:
course of human events
0When in the 78course8 day to day grind 5 of 570playing 1 with3animal and 4human 4 sounds, we run into8events8 beyond our control0