How to Solve the 2 sums Challenge in c++ (Improvement)