Pregunta de entrevista de Amazon

Leetcode 3 sum question, almost exactly