# 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++`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up