I want to cluster an array, this array contain some angle I want to calculate the difference between of these degree and select one group between this array, this group should have maximum number and the difference between the member of that should not be larger than specific number.
for example if specific number is 30 and array is
[10 20 30 40 100 120 140]
answer should be
[10 20 30 40]
100-30 >= 30 so it is not included.