# Growing SubList

Hi
I have a consecutive list of range indices start from 0 to 49 like this :

``````0,1
4,5,6
20,21
49
``````

i want to grow these range with a factor start from 1 until their upper and lower bound reach together
but not overlap.
for example with factor 1 :

``````0,1,2
3,4,5,6,7
19,20,21,22
48,49
``````

and with factor 2 the list would be:

``````0,1,2
3,4,5,6,7,8
18,19,20,21,22,23
47,48,49
``````

how this can be done please

Hello,

One solution can be to add or subtract the same integer to each number, and trim it to the next/previous integer from the average between two consecutive domains.

This is using lists of numbers separated by commas. Using domains would make the code a bit easier.

GrowingSubList.gh (17.3 KB)

With domains

GrowingSubListDomain.gh (15.7 KB)

thanks for solution
i need tweak this one:
the 0 and the 49 in this way should be always appear and they will grow always and if they dont appear in the input list then the first and last will be calculate as bounds and will grow in one direction. for example if the overall indices be the `0` and `49` and the list be the:

``````10
20
30
``````

then the output will be

``````10,11
19,20,21
29,30
``````

and the desired could be:

``````9,10,11
19,20,21
29,30,31
``````

Just input your min/max global values here :

sorry for such question