Given an arbitrary sequence consisting of 1 and A split this sequence up so that A is at the beginning of each sub sequence. Sequences without a leading A and Sequences without 1 before the next A will be self contained.
Example
Input
111A11A1111111A1A1AA
should result in
111
A11
A1111111
A1
A1
A
A
Above already contains the edge cases * sequence of 1 without prior A * subsequent A's without 1 between
Update Open to all programming languages (functional / non-functional)
code-golf
. Also, it might be a dupe -- but I didn't check yet. For future submissions, you may want to use our sandbox before posting to the main site. \$\endgroup\$s/A/\nA/g
task. \$\endgroup\$s/question/challenge/
\$\endgroup\$