From 86dc04f139ca6d0389d71c3da2706a84eb6543d1 Mon Sep 17 00:00:00 2001 From: parte-Ajinkya <112530584+parte-Ajinkya@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:41:46 +0530 Subject: [PATCH] Create permutation-string.cpp --- permutation-string.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 permutation-string.cpp 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<