Given an array nums of distinct integers, return all possible permutations. You may return the answer in any order.
Input: nums = [1, 2, 3] Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] Explanation: There are 3! = 6 permutations of a 3-element array.
Input: nums = [0, 1] Output: [[0,1],[1,0]] Explanation: Two elements produce 2! = 2 permutations.
Input: nums = [1] Output: [[1]] Explanation: A single element has exactly one permutation.
1 <= nums.length <= 6-10 <= nums[i] <= 10nums are distinct.nums = [1, 2, 3]