diff --git a/permutation-string.cpp b/permutation-string.cpp new file mode 100644 index 00000000..cd1f609c --- /dev/null +++ b/permutation-string.cpp @@ -0,0 +1,44 @@ +// C++ program to print all +// permutations with duplicates allowed +#include +using namespace std; + + +// Function to print permutations of string +// This function takes three parameters: +// 1. String +// 2. Starting index of the string +// 3. Ending index of the string. +void permute(string a, int l, int r) +{ + // Base case + if (l == r) + cout<