Samsara Interview Question

I was asked to solve the pair sums problem.