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.
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)