(C++! I didn't know if I should mention it or not)
(Keep the order if at all possible!)
Say I have, and I do, the string ABaC.
I have each character in that string in a vector called temp.
So I have temp[0] = A, temp[1] = B, temp[3] = a, temp[4] = C.
What I would like to do is right a program that outputs every permutation of that string, that results from removing 0 capital letters, then 1 capital letter, then two capital letters, then all 3.
The reason I'm removing capitals is... you shouldn't focus on capitals. It happened that I needed to remove all the capitals here but , for let's say ADbd, I don't need to remove D. So really, an algorithm for removing a set of already known characters from a string.
So it would output:
ABaC|BaC|AaC|ABa|aC|Aa|Ba|a
Not looking for efficiency here or too brilliant of an algorithm. Something simple and long or short and stupid I am more than happy with as well.
This is part of an ongoing project i'm working on that removes lambda productions (which you fine folk helped me with already) So this is the step where I need to construct the new production rules by removing the nullable variables from the rule, one by one, and so on and output every permutation.
But, y'all can ignore that bit. Think of it just as the string. So, any help is greatly appreciated.
Thank ya kindly.