trimDuplicatePools() is very expensive, having O(n^2) complexity and could be simplified
Description
ammRouter:trimDuplicatePools() eliminates duplicate pools in the input by comparing every element of the array for duplicates, which is very expensive.
Note: the function is actually useless as it is impossible to add liquidity in duplicate pools. It would revert with error "SANDWICH".
Recommendation
Force the user to input pool indexes ordered and if there are duplicates, revert. Here is an example of safe using this technique.
Status
Addressed in #8c1e930