Medium Problemsoptimizationgrid

Maximum Tip Calculator

Given n customers in a fixed order and two waiters, where the first waiter can serve at most x of them and the second at most y (with x plus y equal to n), and each customer offers a different tip depending on who serves them, assign every customer to one waiter to maximize the total tip collected.

Do this lesson first: house robber

The full breakdown and animated table for this problem are still being written. In the meantime, run the four questions on it yourself — that is the whole exercise.