solve 3sum by brute force