I've been trying for a couple of days now to make a function and it's driving me crazy.
I need a function that takes a set of numbers in an array, for example:
and produce another array with all possible combinations of those numbers, or just print all the combinations. Like this:
...not necessarily in that order.
I tried doing it with loops and it became too complex, then I tried recursion and it got even more complex. Anybody have any ideas?