Given an array of integers [x0 x1 x2], how do you calculate all possible permutations from [0 0 0] t
- by user319951
I am writing a program that takes in an ArrayList and I need to calculate all possible permutations starting with a list of zeroes, up to the value in the corresponding input list.
Does anyone know how to iteratively calculate these values?
For example, given [ 1 2 ] as input, it should find and store the following lists:
[0 0],
[1 0],
[1 1],
[1 2],
[0 1],
[0 2]
Thanks!