I have a list of numbers: 0,1,2, 200,220,240, 310,330, 371,380,390
I want to put these numbers into four buckets using range with value 40 for example. 0,1,2 are all in range 40. So they should be bucketed together
200,220,240 - same story
301,330 - are in range 40
371,380,390 should be bucketed together.
I don't know how many numbers I would get or how many buckets I would need. I know only range value.
I'm looking for the minimum number of buckets with range R which will contain all numbers in some list of n numbers
I hope there are some algorithms for doing it. Could you please give some pointers? Thanks!