Skip to content

Tag: combinations

All combinations of r elements from given array php

Given an array such as the following I’m looking for a method to generate all possible combinations, with a minimum number of elements required in each combination r. (eg if r = 5 then it will return all possible combinations containing at least 5 elements) Answer A combination can be expressed as nCr =…