The solution is DFS. I tried {0,0,0,1,9} and it returns correct answer. Why do I get Output Limit Exceeded? Thanks.

```
vector<vector<int> > permuteUnique(vector<int> &num) {
size_t size = num.size();
vector<vector<int>> vecs;
if(size==0) {
return vecs;
}
vector<int> vec;
sort(num.begin(), num.end());
helper(num, 0, vecs);
return vecs;
}
void helper(vector<int> &num, int index, vector<vector<int>> &vecs) {
if(index==num.size()) {
vecs.push_back(num);
return;
}
for(size_t i=index; i<num.size(); ++i) {
if(i==index||i>index&&num[i]!=num[index]) {
swap(num[i], num[index]);
helper(num, index+1, vecs);
swap(num[i], num[index]);
}
}
}
```