On Sun, Jul 8, 2012 at 8:32 AM, Joao Silva <lists / ruby-forum.com> wrote:
> => With 0 repeats found the number 1.3, etc.
> => With 1 repetition was found the number: 4, etc.
> => With 2 repetitions was found the number 5, etc.

fire up irb or pry, and play w ruby,
eg,

> a. group_by{|x|x}.group_by{|x,y| y.size-1}.each_with_object({}){|(k,v),h| h[k] = v.flatten.uniq}

=> {0=>[1, 3], 2=>[2], 1=>[5, 4, 6]}