Problem bank
Problem 243 of 333MediumCodingP243
Three trades that net to zero
A list of signed trade quantities is given (positive for buys, negative for sells). Return every distinct triple of values that sums to zero, with no duplicate triples in the output. For example, gives , and . Beat the brute force.
See the hint and solution with a free account
Every problem on Quant Engine is free, with a hint and a full worked solution. Making an account takes 30 seconds and no card. Then you can see them and track what you have solved.