Bloomberg Interview Question

3Sum