If I use next_permutation(), the code will be so short...

```
class Solution
{
public:
vector<vector<int> > permute(vector<int> &num)
{
sort(num.begin(), num.end());
vector<vector<int> > vvi({num});
while(next_permutation(num.begin(), num.end()))
vvi.push_back(num);
return vvi;
}
};
```