Aaron N. Tubbs bio photo

Aaron N. Tubbs

Dragon chaser.

Twitter Facebook Google+ LinkedIn Github

Write a function that accepts a functor, a container of items, and a desired choice size. The code’s purpose is to produce all choices from the input and apply the functor to the selected subset.

Everybody with a computer science degree has been warned of the perils (or joys) of combinatorics and binomial coefficients. That said, I’m convinced (with zero data points) that very few people have ever actually implemented such a toy. With all the focus on implementing the clever and elegant algorithms, I think it might be a lost art actually implementing combinatoric brute-force algorithms.

I may be wrong.