I have an NSArray with numbers {0,1,2,3}
By calculating factorial 4 (array counter), I have 24 possible permutations of 0,1,2,3
I would like to know if there is a way to compute all these possible permutations and put them in a separate array.
For example, given the numbers above, {0,1,2,3}, the resulting permutations will be:
0123, 0132, 0213, 0231, 0312, 0321, 1023, 1032, 1203, 1230, 1302, 1320, 2013, 2031, 2103, 2130, 2301, 2310, 3012, 3021, 3102, 3120, 3201, 3210
Any help is appreciated. Thank you very much!