I would like to get all possible combinations of numbers which are stored in an array.
For example:
Using a first array of {1,2,3,4} return
1,2,3,4
1,3,4,2
1,4,2,3
2,3,4,1
2,4,1,3 etc
How could I do this?
Just to clarify - Take an array of numbers: {1,2,3,4}, rearrange the sequence of numbers, return a new array (add to a list), and repeat until all possible combinations have been found.
Thanks