Refactoring with Enumerable partition
Pro
In this lesson, we will look at how to clean up code that iterates over a collection twice to separate the elements out to only doing so once while achieving the same result by leveraging the partition method from Ruby's Enumerable module.