Given an array nums of distinct integers, return all possible permutations in any order.
Input: Integer array nums of distinct integers.
Output: All permutations sorted lexicographically.
Input: [1,2,3]
Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
Explanation: All 3!=6 permutations.Input: [0,1]
Output: [[0,1],[1,0]]
Explanation: 2! permutations.Input: [1]
Output: [[1]]
Explanation: 1! permutation.1<=nums.length<=6-10<=nums[i]<=10All elements distinct.