Pregunta de entrevista de Amazon

4 Sum question, brute force to optimization.