Skip to content

Instantly share code, notes, and snippets.

@whereisciao
Created April 10, 2014 17:16
Show Gist options
  • Save whereisciao/10403540 to your computer and use it in GitHub Desktop.
Save whereisciao/10403540 to your computer and use it in GitHub Desktop.
Define Array.duplicated
class Array
def duplicated
select { |e| self.count(e) > 1 }.uniq
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment