values of distinct integers. Return every way to line these numbers up, that is, every permutation of them.
Each permutation is a list that contains every number from values exactly once, and no permutation may appear twice. The permutations may be listed in any order.values=[7, -2] → [[7, -2], [-2, 7]]
Two numbers give exactly two orderings.
values=[0, 5, -3] → [[0, 5, -3], [0, -3, 5], [5, 0, -3], [5, -3, 0], [-3, 0, 5], [-3, 5, 0]]
Three distinct numbers give 3! = 6 orderings; the order in which they are listed does not matter.
values=[4] → [[4]]
values ≤ 6values[i] ≤ 10values are distinctvalues=[7, -2]
[[7, -2], [-2, 7]]
Run checks the first 3 tests in your browser. Submit checks all 48 tests on the server, hidden ones included.