Mark As Completed Discussion

Combinatorial Problem: Finding N Combinations

As a first problem, Iet's use a very simple problem from combinatorics-- can you find all possible N combinations of items from a set?

In other words, given a set {1, 2, 3, 4, 5} and an N value of 3, we'd be looking for all combinations/subsets of length/size 3. In this case, they would be {1, 2, 3}, {1, 2, 4}, and so on.

Note that the ordering is not important in a combination. so {1, 2, 3} and {3, 2, 1} are considered the same thing.

Let's now look at the pseudo-code for this N-combination problem:

TEXT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment