1. #!/usr/bin/env ruby
  2.  
  3. class CharsRepeat
  4. def self.number_of_repeaters string
  5. chars = Hash.new 0
  6. string.each_char { |char| chars[char] += 1 }
  7. chars.select { |char,count| count > 1 }
  8. end
  9. end
  10.  
  11. p CharsRepeat.number_of_repeaters 'teestting'