0

I have a list of numbers as shown below. this is actually a list of indexes from a different array that i am working with.. i am trying to group some data according to a condition.. i manage to obtain this array. but i need separate the series of indexes.

array = [0,1,2,3,4,5,9,10,11,12,23,24,25,26,55,56,57,58]

how can i separate this like sub lists as below expected results:

result = [[0,1,2,3,4,5],[9,10,11,12],[23,24,25,26],[55,56,57,58]]
Eshaka
  • 974
  • 1
  • 14
  • 38

0 Answers0