Capital One Interview Question

Array, Greedy, Sorting, two pointers