Question is very simple. If we have
tst = {2,3,4,6,7,9,11}
result must be
{{2,3,4}, {6,7}, {9}, {11}}
There are similar questions, but not exact.
My best solution is:
myFun[arr_] := Module[{prev = First@arr, tag = First@arr},
Reap[
Sow[prev, tag];
Do[
If[prev != e - 1, tag = e];
Sow[e, tag];
prev = e,
{e, Rest@tst}]
]][[2]];
Is it possible to do it better?