Bucket sort in Ruby