0
Define X as non-empty non-self-contain array of X and "1". Split an X into smallest amount of continuous parts Y, length of each of Y don't exceed n, so that each X is either part of a Y, or exactly some Ys. It's fine if output only express which part has how many 1's.
Samples:
[1,[1,1,1]],3 =>...