3Sum (basic version)