You are given an array nums of distinct integers.
Your task is to find and return all possible unique permutations of the integers within nums.
Note that:
nums contains distinct integers.Return a list containing all possible unique permutations.
[0]
[ [0] ]
An array with a single element has only one permutation, which is itself.
[0, 1]
[ [0, 1], [1, 0] ]
For two distinct numbers, there are two possible arrangements.
[0, 1, 2]
[ [0, 1, 2], [0, 2, 1], [1, 0, 2], [1, 2, 0], [2, 0, 1], [2, 1, 0] ]
For three distinct numbers, there are six possible arrangements.
[0]
[ [0] ]