I have a string like this –
A and B or C and (D or (E and (F or K) or S))
Now I want to apply logical AND/OR on it and create all possible groups with only AND conditions, so the output would look like –
['AB', 'CD', 'CEF', 'CEK', 'CS']
giving you another example –
(A and B or (C and D and E)) -
['AB', 'CDE']
looking for some solid python function where we can pass the phrase and would return the decomposed list
1