J.P. Morgan Interview Question

programming: list and combination