Skip to content

Instantly share code, notes, and snippets.

@jeanbaptistebeck
Created July 19, 2016 01:40
Show Gist options
  • Save jeanbaptistebeck/eaf9f40898949bc237a9da524acb13c9 to your computer and use it in GitHub Desktop.
Save jeanbaptistebeck/eaf9f40898949bc237a9da524acb13c9 to your computer and use it in GitHub Desktop.
def duplicate_count(text)
('a'..'z').count { |c| text.downcase.count(c) > 1 }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment