LinkedIn interview question

2 sums