This was a fun problem, but I think lookup table solutions are possible given the way the way the test suite is configured. Maybe you could add a string parser to see if the test suite correct solutions are included in the answer code?
@alfonso Consider the problem statement as the Diophantine equations X+Y=S & X*Y=P ⇔ x^2-S*X+P = 0; (X,Y)∈ℤ. In some of the test cases the list of tuples degenerates to 2, I have noticed for these scenarios both of the tuples satisfy these Diophantine equations, yet the correct solutions is thrown as true when the sum of each tuple is unique and the product of the tuples is equal, and false when the product of the tuples is unique and the sum of each tuple is equal. Is this consistent with your problem statement/explanation above?
For anyone needing a gentle refresher (like I did) on nested anonymous functions: //www.tianjin-qmedu.com/matlabcentral/cody/problems/24-function-iterator
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.