I have a list like this:
l={{12}, {}, {}, {}, {}, {70}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, \
{}, {4}, {}, {}, {10}, {}, {}, {}, {}, {}, {1}, {36}, {}, {}, {}, \
{87}, {60}, {}, {58}, {3, 16}, {}, {56}, {75}, {14, 53}, {}, {30}, {}, {84}, {}, {59}, {35, 45, 68}};
I want to substitute the sequences of {}
with their run-lengths:
compact[l]=={{12}, 4, {70}, 11, {4}, 2, {10}, 5, {1}, {36}, 3, \
{87}, {60}, 1, {58}, {3, 16}, 1, {56}, {75}, {14,
53}, 1, {30}, 1, {84}, 1, {59}, {35, 45, 68}}
Sequence
functions aren't going to be competitors @rhermans. $\endgroup$