Learn how to manually remove duplicates from an array in Ruby without using the uniq method.
Remove duplicate elements from an array in Ruby without using the
Add a method to Ruby’s Array class that manually iterates through a collection and removes duplicate items from the array (without using the built in uniq method).
[1, 3, 4, 1, 4].remove_duplicates # [1, 3, 4]
Real World Usage
Working with collections is key for many different applications. This type of behavior is helpful when cleaning up data prior to passing it to a machine learning algorithm or rendering it to a user.
Can be found on the solutions branch on github.