require 'set's = [1, 2, 3, -1, -2, -4].to_set# Divide the set into sets of numbers with the same absolute value.p s.divide { |x,y| x.abs == y.abs }# => #,# => #,# => #,# => #}>