I would like to avoid redundancy into all possible combinations in a list of string (for example 1122
is the same thing as 2211
in my context therefore only one or the other should be in the resulted list).
I would also like to apply a filter during the combination. For example, I don't want to have any string in the result that contains 3
.
How should I handle this logic?
This code is doing the combination
>>> keywords = [''.join(i) for i in itertools.product(['11', '22', '33'], repeat = 2)]
>>> keywords
['1111', '1122', '1133', '2211', '2222', '2233', '3311', '3322', '3333']