- There are two kinds of items:
AandB - Each item
Bcould be replaced byA'andA" - Given a list with items
AandB(the order is not important), generate the most quantity of target-lists only with itemsA,A'andA"below the time limitt - Each target-list is sorted after generation, so there isn't necessary to generate each permutation (only replacements are sufficient)
- The source list have an arbitrary size
- The number of unique possibilities is
n²wherenis the number ofBitems Aitems doesn't need to be modified, so it could be reused
Given the source list:
[A, A, B, A, B]
These are the relevant target-lists:
[A, A, A', A, A']
[A, A, A", A, A']
[A, A, A", A, A"]
Notice the absence of [A, A, A', A, A"]: as the target list is ordered, this option is not relevant.