Grouping method examples for Scala Vector and Seq
By Alvin Alexander. Last updated: May 21 2018
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 10.19, “How to Split Scala Sequences into Subsets (groupBy, partition, etc.)”
You want to partition a sequence into two or more different sequences (subsets) based on an algorithm or location you define.