To understand the solution, you must be first familiar with bucket sort.
For example, we set the bucket size to be 10, those numbers can be put into above buckets. If we set the bucket size clever(relatively small), we can ensure that the max gap cannot be in same bucket. In worst case each successive numbers have same gap. For example, we have 1, 3, 5 the gap and max gap is (5 - 1) / 2.
Based on this, we only need to compare max number in this bucket and min number in next bucket to get the relatively large gap and find out which two bucket have the largest gap.