I have the list {7, 8, 9, 10, 11, 12, 13, 14} and would like to split it into a list of size 2, a list of size 3, and covert the remaining element into singleton lists, giving the result {{7, 8}, {9, 10, 11}, {12}, {13}, {14}}. Is there a built-in function that allows me to do this?
Asked
Active
Viewed 753 times
3
m_goldberg
- 107,779
- 16
- 103
- 257
user41106
- 31
- 1
FoldPairList[TakeDrop, {7, 8, 9, 10, 11, 12, 13, 14}, {2, 3, 1, 1, 1}]orInternal`PartitionRagged[{7, 8, 9, 10, 11, 12, 13, 14}, {2, 3, 1, 1, 1}]- usual caution re: undocumented/internal functions. – ciao Jun 18 '16 at 23:01