What do you know about the pieces? Based on the example data you show here, some pieces are missing. For instance, the same disk that had the "0111" piece should have had a "111" piece as well, but there's no "111" piece or smaller pieces that would together form "111". Do we have only one piece from each disk?
Do you know how many disks there were?
Do you know what the length of the result is?
Each string was split in exactly two substrings? Your example doesn't make sense in that case (the '11' string specifically).
If each string is split in two substrings:
-length of the string = shortest_substring.length + longest_substring.length
Okay, he gave us a random sequence generator, that would break it into pieces. I took another look at it, and it seems that it indeed give both pieces (Ex: 1011 and 110 for 1011110, as well as giving 10 and 11110, etc.) It was probably a typo =P
But everything is still random. I can't control the length of the final string, neither how many pieces will be there (I know now that it will always be even tho). and there's no way of me knowing whether a piece goes in front or in the back of another one (The code gave me both 1 / 010010 and 100101 / 0 for 0100101).