# Pick two

Computer Science Level pending

What is the optimal asymptotic complexity in which this problem can be solved?

Given a set $$S$$ of $$n$$ integers and another integer $$x$$, check if there exists two elements $$a$$ and $$b$$ in $$S$$ such that $$a + b = x$$

Bonus: Prove the optimality of your algorithm.

×