awesome solution,
*bows in respect
update*
though if the original array will be
(1, 1, 0, 3, 8, 9, 5, 2, 0, 2, 1)
that would give
[[1, 1, 0, 3, 8], [9], [5], [2, 0, 2, 1]]
and if the author want's values be around 5, that's not very good
also if the original massive will be (1, 1, 0, 3, 8, 9, 5, 2, 0, 12, 2, 1)
that would give a completely wrong answer: