Skip to content

Instantly share code, notes, and snippets.

@robertwalsh0
Created February 18, 2013 17:35
Show Gist options
  • Save robertwalsh0/4979084 to your computer and use it in GitHub Desktop.
Save robertwalsh0/4979084 to your computer and use it in GitHub Desktop.
Finding duplicates in an array ruby
a = ["A", "B", "C", "B", "A"]
a.detect{ |e| a.count(e) > 1 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment