My output is 9876543..
Because of the between 1s proposition;
I think I'm getting lost in this: " If a 1 appears as part of the sequence, it is escaped with a 1, thus two 1 characters are output."
I can't understand it, due to my bad english...
Is it that: if you see a 1, and another 1 next, you must return only one 1 ?