Problem Description
Given an array A of size N denoting collection of numbers that might contain duplicates, return all possible unique permutations.
NOTE: No 2 entries in the permutation sequence should be the same.
A = [1, 1, 2]
Input 2:
A = [1, 2]
[ [1, 1, 2]
[1, 2, 1]
[2, 1, 1] ]
Output 2:
[ [1, 2]
[2, 1] ]
All the possible unique permutation of array [1, 1, 2].
Explanation 2:
All the possible unique permutation of array [1, 2].
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.