generate all permutations of string

Solutions on MaxInterview for generate all permutations of string by the best coders in the world

showing results for - "generate all permutations of string"
Laure
26 Jul 2020
1void permute(string a, int l, int r)  
2{  
3    // Base case  
4    if (l == r)  
5        cout<<a<<endl;  
6    else
7    {  
8        // Permutations made  
9        for (int i = l; i <= r; i++)  
10        {  
11  
12            // Swapping done  
13            swap(a[l], a[i]);  
14  
15            // Recursion called  
16            permute(a, l+1, r);  
17  
18            //backtrack  
19            swap(a[l], a[i]);  
20        }  
21    }  
22}  
Andreas
19 Jan 2018
1void perm(char a[], int level){
2
3    static int flag[10] = {0};
4    static char res[10];
5    // If we are the last character of the input string 
6    if(a[level] == '\0'){
7        // First we assign stopping point to result
8        res[level] = '\0';
9        // Now we print everything
10        for(int i = 0; res[i] != '\0'; ++i){
11            printf("%c", res[i]);
12        }
13        printf("\n");
14        ++counter;
15    }
16    else{
17        // Scan the original string and flag to see what letters are available
18        for(int i = 0; a[i] != '\0'; ++i){
19            if(flag[i] == 0){
20                res[level] = a[i];
21                flag[i] = 1;
22                perm(a, level + 1);
23                flag[i] = 0;
24            }
25        }
26    }
27}
28
29int main(){
30    char first[] = "abc";
31    perm(first, 0);
32    return 0;
33}
Selma
10 Apr 2016
1void permutation(string s)
2{
3    sort(s.begin(),s.end());
4	do{
5		cout << s << " ";
6	}
7    while(next_permutation(s.begin(),s.end()); // std::next_permutation
8    
9    cout << endl;
10}
queries leading to this page
how to get all permutationspermutation of a given string without string combination programwhat is permutation of a stringhow to generate all possible combinations of a stringprint 09all 09the 09permutations 09of 09the 09given 09string in javapermutaion of the given stringall permutation of a string in javapermute all charsall string permutations pythona string permutations of length npermutation of charactershow do you find all the permutations of a string 3f what is the running time 3fpermutation function programmingpossible permutations of stringgenerate permutations of a string pythonfind all combinations of a stringto print the possible combinations of any given wordto find permutations of a string in javayou need to write a function to find the desired permutations of a given string desired means 2c all permutation but with restrictions for one character at specific positioprint all anagrams of a stringhow to find all permutations of stringfind all permutation of a stringreturn permutations of a string in a string arraygiven string abc print all possible combinations pythonpermutation of string c 2b 2bpermucation with codepermutation program c 2b 2bfinding all permutations of a stringprogram to find permutationsprint all permutations of a string c 2b 2bpermutatation of stringsc 2b 2b program to find permutations of a stringgenerate all possible combinations of a stringfinding all permutations of an arrayhow to find all permutations of a stringprint all the combinations of a string 2f 2f print permutations to stdoutc program to calculate permutation and combination stringjava code to print all permutations of a stringc program to write permutationspermutation backtrackinghow to permute a stringgenerate all permutations of a string of lenght kstring permutations programfind all possible permutations of a stringgeek for geek permutation backtrackingstring permutations examplesfind all the permutations of an array print them all permutations of stringfind all permutations of said stringhow to check the permutations of a stringprogram for all permutations of a stringpermtation of stringget all permutations of stringreturn permutations stringprint all the permutations of a string of all lengthsprogram that asks for a string of three characters and prints all the permutations javapermutations using backtrackingall permutation problems in c 2b 2bjava permutationget all combinations of string c 2b 2bgenerate all permutations of length ngenrate peruation of string in c 2b 2bpermutions of a stringcount of permutations of stringhow to print all possible permutations of a string in javapermutations of string gslogic for permutation of stringprogram in c to print all permutations of a given string print all possible permutations of a numbergiven a string 2c find and return all the possible permutations of the input string permuatation of a stringprint all the permutations of the given stringpermutation of all stringjava get all permutations of stringcount of all permutations of a stringprogram to make all permutations of a stringhow to check given strings is permutations of each otherpermutations of string exampleprint all permutationspermutation solution c 2b 2bfind all permutations of an array pythonpermutate a stringprinting all permutations of an arrayoptimal approach to print all permutationspermutations of any string meansprogram to find all permutations and combinations of an numberto find permutations of a string in chow many permutations of the a stringpermuations in javabacktracking algorithm find all permutations of a string find all permutations of a number recursiono print the possible combinations of any given wordgenerate all permutations of a string backtrackingprint all permutations onlinepermutaion of a stringpermutations backtracking javaprint all combinations of a string programpermutations of a list of strings recursion c 2b 2bfind all permutations of a strinf c 2b 2bpermute a string in c 2b 2bprinting all permutations of a given stringpermutation c 2b 2b codeall possible combinations of a stringall the permutations of stringwap to find all the combinations of a given string 3fhow to print all possible permutations of a array in javaall permutations of a string gfgdisplay all the permutstion of a stringfind permutation of all stringsall permmutations of given string java8print all the permitations of a stringgenerate permutations c 2b 2bhow to find permutations of a given numberpermutation stringpython print permutations of a stringfind all permutations of a stringgetting all permutations of a stringfind all permutations of an arrayjava inbuilt permutation functiongenerate all the permutations of a stringwhat is a permutation of stringfind all permutations c 2b 2bexample of string permutationpermutation of 10 char string c 2b 2bprint all permutations in javamake a string with a permutations of given sttringsfinding permutations of a stringalgorithm to print all permutations of a stringprogram to write all possible permutations of a given stringpermutations if a given stringprogram to find all permutations of an array in call permutations of a string onlinearray permutations using recursionprogram to find permutations of a stringcount all permutations of a string without inbuilt functionwrite a program to print all permutations of a given string integrationfind all the permutations of a given stringreturn permutations of a string pythonprint all permutation of an arrayprint all permutations of a given stringc 2b 2b code for permutation for word from given characterspermutation of an string c 2b 2bpossible combinations of stringprint all permutation of stringthe first argument is the string you need to save all permutations in the 2 d array passed as 4th argumentall permutations in a string solutionprint permutations of a string pythonjava find all permutationpermutations of string abcdprogram on permutationsfind list of all permutation of stringprogram to print all permutations of a stringrecursive solution to permutation of stringwrite a simple code to implement string permutation using backtracking string abcd has 24 permutation permutation of a given stringprint all permutations of a stirngrecursive string permutation javagenerate string permutations in pythonto print permutations of a string javafind all permutations of given length of a stringformula to count all the permutation of a given stringgenerate all permutations of an arraypermutation of list problem explained javaprinting all permutations of a string gfgprint all permutations of arrayin a given string s print all of its unique permutations function giving all permutations of a stringall permutations of a string c 2b 2bgetting tle in printing all permutationsfind all permutationsgiven a single input string 2c write a function that produces all possible anagrams of a string and outputs them as an array youtubegiven an input string 28str 29 2c print all possible permutations of the input string print all the permutation of stringspermuatation of stringpermute a stringfind all the permutation of stringpermutations backtrackingprint all permutaion of stringprint all combinations of a string without duplicates java cabjava program to find all permutations of a stringprint permutationgiven string abc print all possible combinationspermutations of a string in javaall array permutations using recursionstring combination in c 2b 2bget permutations of stringprinting permutations of a stringprint permutation of a astringcheck all permutations dynamic programmingall string permutationsprint all permutations of a string in cgenerate all permutations of a numberhow to print all permutations of 4 numberswrite a program to print all permutations of a given string using recursionprint all permutations using permuation stl functionprint string permutaionhow to get the permutation of stringprogram to generate permutations of a stringallpermutations of a stringprint permuattaions of lettershandling permutation ploblems c 2b 2bget all permutations of textgeeks for geeks permutationcode of all the permutations stringwrite all permutations of a stringpermutations of a given string in cprogram to print all permutations of a string without using inbuilt functionhow to find all the permutations of a stringreturn permutations of a string using loopsall possible combinations of stringpermutation of string 22java 22count permutations of a stringfind all permutations of a in bprint all permutations in arrayhow t list all premuatations of stringgenerate all permutation of stringgenerate all possible permutations different permutations of a stringfind all permutations of a string pythonstring permutation in cpp recursioncreate all permutations of a string using recursionjava program to print all possible combinations of a stringspermutation of a stringpermutation stringsstring permutationswrite a program to print all permutations of a given string iin cpython permutations of stringpermutation in a stringwrite all permutations of arrayprint all possible combinations of a stringjava code to print all permutationsprinting all possible combinations of a string in cpermutation logicstring permutation algorithm explainedfind all the permutations of a string in javahow to find all permutations of string in javahow to find permutations of a number and stringpermutation code in javapermutations of a string c 2b 2bpermutations with recursionprint all possible permutations of a given string program to find all permutations and combinations of an arrayprint all the anagrams of a stringarray permutations using recursion cppall permutations of an arraywrite a program to print all permutations of a given string iterativelyprint all permutations of arraypermutations of given string in javapermutations of array using backtrackingpermute string cjavahow to find all permutations of a string in pythonrecursion permutationq what is recursion 3f write an program tp print permutations of a string using recursive approach generate all anagrams of a stringpython permutations of a stringstring permutation c 2b 2bhow to print all possible permutations of a stringpermutation oif a stringprint all permutation of a stringforming all permutations of a given arraypermutation javapython generate all possible permutationspermutation geeks for geeksfind permutations of a string countpermutation algorithm recursivebacktracking permutationsfind all permutacions of a stringfind all permutations of a string of length npermutation of stringscalculate permutation of a string toolstring permutation sample datacreating string permutationwrite an algorithm to find permutations of a stringdp to print all permutations of a stringpermutation in programmingstring permutation tutorialfinding the permutations of a stringprint all permutations of a string recursioncount the permutation of a stringhow to print all permutations of a string 22the first argument is the string you need to save all permutations in the 2 d array passed as 4th argument 22permutation recursivedisplay different arrangements in javagenerate all string character permutations solutionsnumber of string permutationsno of permutations of a stringprint permutations of a stringfind all permutation of a string geeksforgeekshow do you find all permutations of a string 3fprint all permutaionprint permutaions of string c 2b 2bhow to find permutation of a string in pythonall permutationprogram to print all permutations of a given stringall permutation of a stringpermutations of strings in c how to print all the permutations of a number c 2b 2bpermutation of string examplepermutation java codepermutations in stringsolution to find the permutations of a stringfind permutation of stringpermutation of string using cfinding all the permutations of a stringreturn permutations of a string find all possible combinations of string java find permutations of a stringto find all permutations of the stringreturn all permutations of a string c 2b 2b recursionget all possible permutations of a string javawrite a function to calculate all permutations of a given string in pythonprogram for printing string permutations in javahow to generate permuations in javagenerate all possible permutations of a stringwrite a program to print all permutations of a given integers stringpermutations of a string formulapython program to print all permutations of a stringpermutation of string in cget all permutations javajava get all permutationsprint all the possible permutations of a stringfind all permutations of stringall the permutations of a stringwrite a simple code to implement string permutation using backtracking string abc has 24 permutation finding permutations of a string javapermutauion of a stringfind permutations of a string geeksjava all permutations of stringfind all permutations of a set of stringgenerate all permutations javausing permutaion find all combination of a stringlinear solution permutations within a stringwrite a program in any language 28c 2fc 2b 2b 2fjava 29 to print all the permutations of a string without using library functions permutations of a string in java backtrackingprint all permutation of a string and substringgenerate string permutationshow to print all the permutations of a stringall possible permutations of stringfinding permutation of stringgve all permutationhow to generate permutations in javapossible combinations of a string in c 2b 2bpermutation of string programgenerate all permutations for 5 numbershow to find all permutations of string 3fpermutations of string in javagiven a string s the task is to print all permutations of a given string find all the possible combinations of a stringpermuation logic in programmingpermutation of given stringall permmutations of given stringfinding all the permutations of a arrayall permutation functionall possible permutations of a string integerfind all the permutationspermutation gfgpermutation string c print permutations 28permutations 29 3bget the permutation of a stingstring all permutations java programprint all permutations of a string javaprint all permution of a string in javagenerate all permutations of an array recursion geekspermutation of string 22java 3agenerate all permutations from a string javapermutation of stingdsprint all permutations of a string in best possible complexity in pyhongnerate all possible distinct strings in java cabpermutation codeall permutations of a string without inbuilt functionpermutate of a stringtotal permutations of a string formularecursion find all permutationspermutate a string using permutation array c 2b 2bnumber of permutations of a stringpremutation of stringprint permutations of a string jafind all permutations of a string in pythonpermutations and combinations of a string in javaall permutations of a string javapython get permutations of stringall permutation of stringhow to generate all permutations of a string arryaprint all permutations of a given string gfghow to print all the permutations c 2b 2bfind permutations of a string java generate all permutations of stringrecursively generate permutations c 2b 2bwhat is permutation in stringcreate all permutations of a stringgenerate all permutations of a stringpermutation algorithm codeprint all permutations of a set javamake permutations of stringhow to print all permutations of a string in pythonwrite a program in any language 28c 2fc 2b 2b 2fjava 29 to print all the permutations of a string without using library functionsreturn all possible permutationswrite a c program to print all permutations of a given stringhow to print the permutations of a stringall permutations of an string javahow to generate word from a given character array using permutationc program to find permutations of a stringpermutations of a givem string programreturn all possible permutations cppall permutations stringprint all permutations of a string pythonpermute stringprint permutations of a string javaall permutations of string how to generate all permutations using recursionfind all possible arrangements of stringpermutation string algorithmget permutation of a given number of stringfind all permutation functionjava inbuilt permutationhow to print all purmutation of charechters in a string in javafind all permutations of a string in another stringpermutation solution javaprint permutations of a strinpermutation of a string javafind number of string with permutationsfind all the possible combinations of a given stringgeek for geek permuation of a stringprogram to find all permutations of a stringpermutations for a given string abc using recursionhow can you find all permutations of a string in pythonpermutataion of stringget all permutations of a string pythonpermutations for a given string abc using iterativefind all permutations javaint to string permutation and combination in javafind all string permutationsget permutations of a given string javapermutations of a string of all sizeshow to print all permutation of string in pythonprint all permutations of a string without changing positionprint all permutations of a string 2farray gfgpermutations for a given string abcprint all permutations of a string in python 3permutation using recursion geeksforgeeksall permutations of a string given nall possible anagrams of a stringprogram for all permutation of a string total permutations of a stringfind all permutations of a characters javapython generate all permutations of stringhow to find the permutations of a stringhow to find possible permutationsfind all permutations of a string gfghow to find all permutationspermutations of a string javapermutaion of stringstring permutations of all sizepermutation string in cmost effective string permutation algorithmprint combinations of string in javacount string permutationspermutation in java geeksforgeeksprint all combinations of a string c 2b 2bprint all the permutations of a stringhow to print all permutationshow to find permutations of a string in javawrite a program to print the possible combinations of any given wordprint permutations 28permutations 29 3bpermutation of stringprint all permutation of numbers write a program to print permutations of a stringparmutation of string in c programmingreturn permutations of a string c 2b 2b using recursiongenerating repeated permutations in c 2b 2bwrite a program to print all permutations of a given string in python sudoko print all permutations of a string 2farrayalgorithm to print all possible combinations of characters in a stringhow to print all the permutations of given characters in javastring permuationall permutations of a string abcgenerate permutations of lettersfind all permutations of a string onlinestring permutaion without backtrackpermutation in string javapermutation and combination of string print all string permutationsfind all the permutations of a given wordwhat is permuttion of a stringfind permutations of a string forumlawhat is a string permutationhow would you create all permutation of a string 3fjava program for permutations of stringspermutation of a string using backtrackingpermutation string in javaprint all combinations of cab in javafind permutations of a string pythonprint permutations of an arrayreturn permutations of a string in arraypermutation in javapermutations of word geeksforgeeksonline print all permutations of a stringwrite a program for printing the permutations of a string write a java program to find all permutations of a string 3fprint all combinations of a string javaprint all permutation of string both iterative and recursive way find all the permutation of a stringgenerating permutations using recursiongenerate all possible permutations of an array20 write a program for printing the permutations of a string all combinations of a string algorithmhow to find permutations in javaprint the permutaion of given stringc program to print all permutations of a given stringpermutations of a array recursion c 2b 2brecursively generating all the combinnations of a stringjava program to print all permutation of a stringfind all permutations of all length of stringpermutation recursionwrite a cpp code to list the permutations of the given numbersstring combinations in javaprinting all permutations of a string 5cfind all permutation of string permutations of a string gfggiven a string s 2c find and return all the possible permutations of the input string different permutations from a given stringprint permutation of a strinhgenerate all permutations of a string onlinebacktracking permutationyou are given a string s your task is o print all possible combinationhow do you find all the permutations of a string 3fpermutation of a string in cwrite a java program that print permutations of a setpermutation of string in o 28n 29given a string 2c your task is to generate all different strings that can be created using its characters all permutations of a stringfind all permutations of a string recursionprinting permutations of a string itertoolsprogram to generate all permutations of a stringpermutations of a string using recursionreturn every permutation of a stringhow to get all permutations of a stringfind number of permutations of a string in pythonwrite a program to display all possible permutations of a given input stringhow do you find all permutations of a stringwrite a program to print all permutations of a string generate permutations of a stringgenerate permutations javawhat is a permutation of a stringpermutations of letters algorithmprint permutations of a given stringprograme to print all pemutations of a stringhow do you find all the permutations of a stringhint for printing all permutations of an arrayprint permutationsprint permutations in a array recursionhow to print all combinations of a stringwrite a program to print all the combinations of the given word with or without meaningpermutation and combination string questionsall combinations of a stringhow to create permutation stringc program to permutation and combination stringget all permutations of a given numbercode to generate all permutations of a stringgenerate all permutations of a given stringhow to generate all permutations of a stringreturn permutattion of stringwrite a program to count all permutations of a given stringbest string sequence cominations c 2b 2b programprint all permutations of a string without changing positionscalulate permutations of a string in javagenerate all different strings of a given string c 2b 2bhow to find the one string is the permutations of the otherstring permutation geeksforgeeksfind all permutations of all length of a stringgiven an array of 3 characters print all permutation combinations from the given characters8 how to find permutations of a stringstore all permutation of a stringpermutations of the stringfind the permutations of a string in javastring permutation javaall possible combination stringthis code counts all permutations of a string strings permutations of given strings in javapermutation between n stringpermutations codepermutation using recursionpermutations of a string pythonpermutation allget all permutations of a stringpermutations of a given stringgenerating all permutations of an arraywrite a program to print all permutations of a string in c 23print all permutations pythonpermutation of a string 28backtracking 29 should work for string as well as integerrules of permutation of a stringjava program to find permutations of a given stringall permuations of a stringfind permutations of a string in another stringfind all permutations of a string in javagenerate all permutations of a string lhow to print all permutation of a stringstring generation acode recursionprinting all possible combinations of a stringpermutations of string java backtrackingprint permutations in recursionfind all permutationhow find permutation in stringcode to display the permutation of a given stringjava print all permutations of a stringpossible string permutationsstring combination in javagenetate all permutations of a stringis all permutations of a string regularall permutations of a string pythondisplay all possible permutations of a stringfind all combinations of a given stringpermutations of stringprogram to print all permutations of an arrayformula for finding permutations of stringfind all permutations of a string youtubeprogram to find permutation of all leters in javahow to find permutation of a stringhow to print all possible ways in java backtrackingcalculate number of permutations of a stringgiven a string s the task is to print all permutations of the characters in the given string print all possible anagrams of a stringpermutation of given string in java find all permutations in a stringpermutations of all characters in a stringprogram to print all permutations of a string without using any inbuilt functionhow to generate all possible permutationsfind out all the possible permutations of the characters in the string passed to the method findpermutations 28 29 calculate all posible permutations of a stringpermutation of string in javastring permutationprinting all permutations of a string in o 28n 21 29all the pemutation of the stringrecursion that will find the permutations in c 2b 2bprogram to print all permutations of a string in javareturn permutation of string in javaget all permutationsprint all permutations of a string in java practiceprint all permutations of an arrayhow to find permutations of a stringhow to see all permutations of arraycount all permutations of a stringpermutations gfgprint all permutations of stringprint all possible permutations of a stringprint all permutationprint all permutations of a string without duplicates java cabparmutation of any name in c programmingprogram to find permutation of a stringhow to find all combinations of a stringpermute string c 2b 2bfind permutations of a string in javagenerate all permutations of a given lengthfind the permutation of a letter from a string print all permutations of a string in javaprint all permutations of a stringhow to print all anagrams of a stringwrite a program to find permutations of a stringconstructing all permutations of array javaall permutations of a string in pythongenerati all the permutaion of a stringfind all the permutations of a string in pythonpermutations without dups 3a write a method to compute all permutations of a string of unique characters permutation of array in javaall permutations of a string recursionstring permutations problem perint permutaion of a string javawrite a program based on the allbutoneprogram that makes a set out of its command line parameters and call permutations javaprint all combinations of a stringprint all permutation of string both iterative and recursive way 3fpermutation of string in c with recursionnumber of permutations of given stringall permutations of a string of digits cppgiven a string s of length n 2c print all permutations of the string in a separate line you have string with two words bca 26 cab 2c duplicate themgenerate all permutation of a given stringprinting all permutations of a stringfind permutation in a stringpermutation programkeval recursion for permutationpermutation of list using backtrackingprint all permutations javato print permutations of a stringgiven a string 2c find and print all the possible permutations of the input string how to print all permutations of a arrayall possible permutations of a string pythonprint all permutation of numbers in javapermutation of a given numberhow may permutations if a stringpossible permutations of a stringcalculate permutation of a stringhow to print all permutations of a string in c 2b 2bget all permutations of a string javaall permutations of a given string with o 28n 2an 29string permutations given a string s the task is to print all permutations of a given stringpermutation using backtrackingfind all possible permutations of the given characterscode permutationspython permutations of a given string using inbuilt functionhow to find permutation of string in javacode to find permutationspython print all permutations of a stringfind all the permutations of a stringhow to find permutationsall permutations of a arraywrite a program to find permutation of the setstring permuatationwrite a recursive function for generating all permutations of an input string return them as a set print permutation percentage of a stringpermutation of a string codeprint all permutations of a number c 2b 2b recursionprogram to print permutations of a stringstring permutation sampleprinting permutations of a string in chow to get all permutations of a string javaprint all permutations of a given string 7cfor a given string s be the number of possible permutations pythonstring permutation in javaprint all the permutations of an arraywhat is permutation of stringc program on permutation of string abcprint all permutations of a string 2farraygenerate anagrams of a stringfind all the possible permutations of a given stringfind all permutations of a string c 2b 2bform selsefull permutation from stringprint all permutations of all lengths of a stringprint all permutations of aarrayall permutations of a string of charactersjava program to find all permutations of a string by java templegenerate all permutation of a statementprint permutations of a string questionfind the all permutations of a given arrayprint permutations of a given string in pythonjava all permutations of a stringkeylock coding problem permute through stringprint permutattion stringstring combinations 1permutations to print string using c 2b 2b recursionpermutation of the stringnumber of permutations of a string in call possible permutations of a stringprint all possible combinations of stringprogram to print the all the permutations of a stringwrite a program to print all permutations of a given string in javawrite a program to write all permutation of a give stringhow to print all possible combinations of a string in cppfind the permutations of a stringcombination of string in c 2b 2bthe most optimal solution to print all permutationyou have string with two words bca 26 cab 2c duplicate them and print alphabetical order using array 26 list and explain 3fget all permutations from a string pythonprint all permutations that can be formd from given stringsall possible combinations of stringsprogram that permutes all the characters of a stringstring permutatiobhow to find all the permutations of a string in pythonjava program to take a string and print all possible permutationspermutation in stringstring permutations in javapermutations program javac 2b 2b code to find all permutations of a stringstring permutation 5cpython get all permutations of a stringall permutation of string pythonprint all permutations if number is given for lettersprint all strings of cab in javapermutation of abcall possible combinations of a string in javapermutations of given stringfind permutations of a stringprint permutations of a string in javawrite a program to print all permutations of a given stringpermutations of a stringfind all permutations geeksforgeeksprint all th permutations of a string gfgpermutation string backtrackingprint all permutations of a string c 2b 2b recursionpermutaitons of an array recursionprint all permutations of a string array by recursionsgn in permutation meaningpython get all permutations of stringpermutation java programhow to find all permutations of string in java programfind all permutations of a string javaall permutations of a string 22recursion 22python generate all permutationsfind all the possible permutation of a given stringhow to print all possible permutations of a string of a specific length permutations of a given string in c 2b 2bwrite a program to print the permutations of a string find permutationsprinting all permutations of nwrite a program to print all the combinations of the given word with or without meaning 28when unique characters are given 29 print all the permutations of a string in javahow to print differnt combinations of a string abpermttuations of a given stringgenerate all permutationsprint permutation of a stringhow to find the permutation values of every of a given stringfind all permutations of a length k of a stringgenerate all permutations of string