Given an integer array nums, return a list of all DISTINCT permutations of nums. The output list must be sorted lexicographically by element sequence. If nums has duplicate elements, duplicate permutations must appear only once.
Input: An integer array nums.
Output: Return a list of lists: 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: Six permutations in lex order.Input: [1,1,2]
Output: [[1,1,2],[1,2,1],[2,1,1]]
Explanation: Three distinct permutations.Input: [0]
Output: [[0]]
Explanation: Single-element array.1 <= nums.length <= 7-100 <= nums[i] <= 100