Algorithm to find out if a set contains two number with sum in the same set using a blackbox function I need help with the following question -
There is a set S of n integers.
Given a black box which returns three integers a,b,c in S such that a+b+c = 0 if they exist.
One needs to devise an algorithm that makes only one call to the black box to find out if S contains
three integers such that a+b=c
The question also had a hint -
Construct a set S' such that there exists  a',b',c' in S' such that a'+b'+c'=0 if and only if
there exists a,b,c in S such that a+b=c
Thanks
Your question is essentially answered on the Wikipedia page on the 3SUM problem, specifically the part on 3 different arrays.