Zenefits interview question

2 Medium-Hard Greedy, DP problems