Skip to content

Instantly share code, notes, and snippets.

@MaxPleaner
Last active November 22, 2016 20:10
Show Gist options
  • Save MaxPleaner/2dda17e49190674173e4023a680d344d to your computer and use it in GitHub Desktop.
Save MaxPleaner/2dda17e49190674173e4023a680d344d to your computer and use it in GitHub Desktop.
core util
require 'set'
class CoreUtil
def find_array_duplicates(array)
set = Set.new
array.select { |elem| !set.add?(elem) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment