I want to group an array, this array contains some angle. I want to calculate the difference between these degrees and choose one group between this array, this group should have a maximum number, and the difference between a member of this should not be more than a certain number.
for example, if a specific number is 30
and an array
[10 20 30 40 100 120 140]
the answer should be
[10 20 30 40]
100- 30 > = 30 , so it is not included.
source
share