In this series, I will explain my thought process of figuring out one way to solve a particular LeetCode problem and then provide the JavaScript code. 46. Permutations The objective is to find out all combinations of a certain array of numbers. Input: nums = [1,2,3]
Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] I’m writing…