Johnson & Johnson interview question

Three Sum and problems with C++ code