General Dynamics interview question

I was asked the programming problem 2 sum