Created
February 18, 2013 17:35
-
-
Save robertwalsh0/4979084 to your computer and use it in GitHub Desktop.
Finding duplicates in an array ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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