I have a String of following structure:
How to get all combinations? The rule is that options inside parenthesis should not go together. For this example the output should be:
There can be parenthesis, but it can be without it. Another example:
N3P5(L1,L2)Q1, output should be:
Anyone with elegant solution?