Basic Sum Questions

2 sum, 3 sum, 3 sum closest, 4 sum. Solutions for all these questions
are based on two principles: one is that the input array should be
sorted, the other is that 2 sum can be easily done in O(n) with an
sorted array.