Below, you can find another hint for the Challenge.
You should only get here after reading, digesting, and applying the .
We can put the special strings '|', '+', and ' ' at the very beginning of S, and ignore them while processing S, by not starting at index 0, but at an appropriately higher index.
Can you implement this idea?
Try your program in the machine, and see if you can extend it to a complete solution.
It is your turn ...
If you tried this hint, or do not see how it helps, then you are ready for the .