Hello, Luca Fenzi. This looks like an interesting problem. However, it can still be improved a bit. (1) It is recommended that at least four test cases be provided, though more are often necessary to prevent hard-coded workarounds. (2) The Test Suite does not rigorously check the individual elements of the output vector, only their sum; that leaves it open to passing completely incorrect submissions as demonstrated in Solution 1575892. (3) In the Problem Statement, it is highly unlikely that the output would be exactly [4, -1]; the presence of random perturbations means that the output might be [4.3, -1.2] or [3.9, -0.8], say. Although there is a suitable allowance in the Test Suite for 'random' variation in the outputs, it would still be advisable to amend the Problem Statement. —DIV
355 Solvers
321 Solvers
373 Solvers
2695 Solvers
295 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!