Created
April 23, 2021 16:54
-
-
Save cabo/7d69b2e8030524cf59c6b14e06dd7483 to your computer and use it in GitHub Desktop.
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
class Array | |
def uniq_c | |
each_with_object(Hash.new(0)) { _2[_1] += 1 } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment