Nokia Interview Question

I was asked to solve 2-sum problem