input =>
List integerList =[1,2,3,4,30,31,50,51,100];
expecting output =>
List subLists =[[1,2,3,4],[30,31],[50,51],[100]];
basic criteria, subtraction result of each in between values of subgroups should be less than 10
input =>
List integerList =[1,2,3,4,30,31,50,51,100];
expecting output =>
List subLists =[[1,2,3,4],[30,31],[50,51],[100]];
basic criteria, subtraction result of each in between values of subgroups should be less than 10
2
Answers
OLD ANSWER
Here’s an example (assuming grouping by number length):
EDIT:
NEW ANSWER
I believe this could do what you like:
This function return what you want: