Given an integer array input_array that may contain duplicate elements, return a list of all unique permutations of input_array. Each permutation should be represented as a list of integers. The order of permutations in the output does not matter.
Example 1
Input: [2,2,1]
Output: [[2,2,1],[2,1,2],[1,2,2]]
Explanation: All unique permutations of [2,2,1] are listed.
Example 2
Input: [0,0,0]
Output: [[0,0,0]]
Explanation: Only one unique permutation exists for [0,0,0].
Constraints
Case 1
Input: [3,3,2]
Expected: [[3,3,2],[3,2,3],[2,3,3]]
Case 2
Input: [4,5,4]
Expected: [[4,5,4],[4,4,5],[5,4,4]]
Case 3
Input: [1,2,2,1]
Expected: [[1,2,2,1],[1,2,1,2],[1,1,2,2],[2,1,2,1],[2,1,1,2],[2,2,1,1]]
Case 4
Input: [-1,0,-1]
Expected: [[-1,0,-1],[-1,-1,0],[0,-1,-1]]