Keep the max - 1 largest groups by magnitude, in their given order, and fold the rest into other(rest).
max - 1
other(rest)
Keep the
max - 1largest groups by magnitude, in their given order, and fold the rest intoother(rest).