136: Permutations 2

Given an array of integers that might contain duplicates, return all possible unique permutations

 

Example 1

Input:   [1, 1, 3]

Output:  [[1, 1, 3], [1, 3, 1], [3, 1, 1]]

Example 2

Input:   [0, 1]

Output:  [[0, 1], [1, 0]]
Difficulty:Medium
Topic:Backtracking
Problem #:136