Given an array of distinct integers, return all possible permutations in any order.
permutations([1,2,3]) => [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
Waiting for you...
CodeBot will comment on your code as you write...
Click "Run Code" or press Ctrl+Enter to test your solution