Simple task today. Given a string whose length is one less than a whole power of 2, divide it into segments with doubling length.
For example for the string abcdefghijklmno
, the result should be a
, bc
, defg
, hijklmno
:
abcdefghijklmno (length 15)
a length 1
bc length 2
defg length 4
hijklmno length 8
The input will not be the empty string.
This is code-golf; shortest solution per language wins.