30
1
Inspiration.* I cannot believe we have not had this challenge before:
Task
Given one or more printable ASCII strings, interleave them by taking one character from each string, cyclically until out of characters. If a string runs out of characters before the others, just skip that one from then on.
Examples
SIMPLE gives SIMPLE
POLLS and EPEES gives PEOPLELESS
LYES and APRONS gives LAYPERSONS
ABCDE and a c and 123 567 gives Aa1B 2Cc3D E567
"\n$?* and (empty string) and ,(.)" (trailing space) gives ",\(n.$)?"* (trailing space)
* There are shorter APL solutions.
Since this is basically just a transpose operation, we've had a few challenges that are very similar, but possibly none that are exactly the same. – Martin Ender – 9 years ago
7I had this question on my CS HW, does that mean I can close this as a homework question? ;P – Downgoat – 9 years ago
@EriktheOutgolfer Cool! I learned something today. – Adám – 9 years ago