Permutations

Given a collection of numbers, return all possible permutations.
Example
[1,2,3] have the following permutations:
[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].

Login to see Answer and Coaching Session More interview questions