FUNCTIONAL PEARL: Marble mingling

Sharon A. Curtis · Journal of Functional Programming · 2003

A bag (literally and mathematically!) of marbles is deemed to be mingled if all the colours of the marbles are different. Given a positive integer $k$ and a collection of $m$ marbles, our objective is to try and extract as many mingled bags as possible from the collection, where each bag contains exactly $k$ marbles.

Read the paper · More papers on PaperTik