Last active
November 22, 2016 20:10
-
-
Save MaxPleaner/2dda17e49190674173e4023a680d344d to your computer and use it in GitHub Desktop.
core util
This file contains hidden or 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
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