 What up you two Mike the Coder here today? We are going to go over the next actually we skipped a few pro I'm gonna skip a few problems to creating strings because the other two I think coin coin piles and Tower of Hanoi are harder than creating strings. So I'll go over kind of creating strings Okay, given a string your task is to generate all different strings that can be created with its characters so essentially you're just trying to Print out all the possible permutations of the characters. So given a string a length of n each character is between a to z First print letter K the number of strings of that you could Print out and print out K lines the strings in alphabetical order So if you look at the input a a b a c, right? This is like the the characters that you want and now you what you do is you're gonna print out all the possible Permutations permutations not combinations my bad permutations of the string by reordering what you could do and The total is 20 for this one. Okay, so how do you do this problem? This is actually really easy if you know how to use the STL library So if you know how to use STL library and C++ it is very easy You just first you would just sort the whole string right by alphabetically So given the string of a a b a c We're gonna sort it and then we get a a a b c and then after that all you just have to do is you just have to call next permutations Passing in the string and then it will just continually print out the next permutation for all the permutations So that's all you have to do actually and I'll just show you guys the code because this is pretty easy Okay, so here I have the string s and then I just read an s Okay, so this I have a string s and I read an s and then I just sort it so I sort as stop begin an s dot end And then I create a vector which is gonna be kind of like your array of all the strings You could possibly do and then I call it answer and then what I do is I do do while While there's the next permutation passing in s stop begin an s dot end We're just gonna push back s So what this code does is it just generates all the permutations and it adds it into our vector Answer Okay, then after that we just print out the size of our answer of our vector and then we just for each value We're just gonna print out the string for each value. So for auto x inside answer. We just print it out Okay, so that's legit the only thing you need to do in this code You don't need to do anything else. It's pretty easy If you want to code your own next permutation that is harder But because we're using STL now and we don't want to just recreate the whole thing ourselves Yeah, I hope you guys enjoyed this video right come subscribe. I'll do The other two problems I skipped. I believe I'll do the coin piles in Tower of Hanoi Later after this. Yeah, Ray com subscribe. I'll check you guys later. Peace