Solving Permutations in Javascript. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Given a collection of distinct integers, return all possible permutations.


Input: [1,2,3]


See the full details of the problem Permutations at LeetCode

Originally posted at: