Bloomberg Interview Question

Some DP problems