The survey of permutations of finite sets is an important subject in the fields of combinatorics and group theory. In elementary combinatorics, the K-permutations, or partial permutations, are the ordered agreements of K distinct components choose from a set. Stedman widens the consideration of permutations; he goes on to consider the number of permutations of the letters of the alphabet and of horses from a stable of 20.A first case in which apparently unrelated mathematical questions were study with the help of permutations happened around 1770, when Joseph Louis Lagrange, in the survey of polynomial equations, detected that property of the permutations of the beginnings of an equation are associated to the possibility to solve it. Fabian Stedman in 1677 described factorials when explaining the number of permutations of Bell in change ringing. The rule to determine the number of permutations of n objects was known in Indian culture around 1150.

COMING SOON!

```
class Solution {
public:
vector<vector<int>> permute(vector<int>& num) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
vector<vector<int>> result;
dfs(num, 0, result);
return move(result);
}
void dfs(vector<int>& num, int step, vector<vector<int>>& result) {
if (step == num.size()) {
result.push_back(num);
return;
}
for (int i = step; i < num.size(); i++) {
swap(num[step], num[i]);
dfs(num, step + 1, result);
swap(num[i], num[step]);
}
}
};
```