Hello,

I've found a good explanation on how to attack this problem at http://decomplexify.blogspot.com/2014/05/permutations.html

The website has very good explanation but I don't know Java so I'm sharing my C++ implementation.

```
class Solution {
public:
vector<vector<int> > permuteUnique(vector<int> &num) {
sort(num.begin(), num.end());
vector<vector<int>> result;
result.push_back(num);
while (true){
if (!nextLargePermutation(num)) break;
result.push_back(num);
}
return result;
}
bool nextLargePermutation(vector<int> &num){
int i=num.size()-2;
for (; i>=0 && num[i] >= num[i+1]; i--) {}
if (i<0) return false;
int j=num.size()-1;
for (; j>i && num[j] <= num[i]; j--) {}
swap(num[i], num[j]);
sort(num.begin()+i+1, num.end());
return true;
}
};
```