I have
a = [\"a\", \"d\", \"c\", \"b\", \"b\", \"c\", \"c\"]
and need to print something like (sorted descending by number of occurrences)
puts a.uniq. map { | e | [a.count(e), e] }. select { | c, _ | c > 1 }. sort.reverse. map { | c, e | "#{e}:#{c}" }