---
# System prepended metadata

title: 'Permutations [4 kyu]'
tags: [C++, CodeWars]

---

# Permutations [4 kyu]

[Permutations](https://www.codewars.com/kata/5254ca2719453dcc0b00027d)
4 kyu

## Solution
```cpp=
/**
*** Author: R-CO
*** E-Mail: daniel1820kobe@gmail.com
*** Date: 2020-08-10
**/
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

vector<string> permutations(string s) {
  std::sort(s.begin(), s.end());
  vector<string> output;
  do {
    output.push_back(s);
  } while (std::next_permutation(s.begin(), s.end()));
  
  return output;
}

```

## Result

PASS


###### tags: `CodeWars` `C++`
