6️⃣ Permutation
#include <iostream>
#include <cstring>
using namespace std;
void Permutations(char* pa, int left, int right){
if(left==right)
cout<<pa<<endl;
else{
for(int i=left; i<right; i++){
swap(pa[left],pa[i]);
Permutations(pa,left+1,right);
swap(pa[left],pa[i]);
}
}
}
void Permutation (char pa[]){
Permutations(pa, 0, strlen(pa));
}
int main(){
char pa[]="abcd";
Permutation (pa);
return 0;
}