Combinations Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example
The complexity is O(C(n,k)) which is O(n choose k).
O(C(n,k))
O(n choose k)
This ends up being equivalent to O(min(n^k, n^(n-k))).
O(min(n^k, n^(n-k)))