Use comprehension instead of recursion on two sums problem