Maximize operations by removing target-sum pairs | MathWorks