Given a set of numbers is there any algorithm or methods available to split them in to different groups and count them ?
something like :
input : [1,2,3,4,5,100,200,1000,2500,3000]
output : 1-5 : 5
100 -200 : 2
1000 - 3000 : 3
input : [1,1,2,3,4,5,6,7,8,9,10,11,15,75,80]
output : 1 - 15 : 13
75 - 80 : 2
input : [1,100,1000]
output : 1 : 1
100 : 1
1000 : 1
Say number of groups should be minimum 2 to maximum 10. How this can be done ?