Nokia interview question

I was asked to solve 2-sum problem