The last row has k jobs
transcript
A queue runs jobs of different kinds. Equal kinds must wait a cooldown. Find the longest cooldown with no idle time. Do not build any schedule.
Find the top count, called m. Make m minus one rows of cooldown plus one. Add a last row with k jobs.
Take jobs A, A, B and B. Both kinds occur twice, so k is two. Assuming one job in the last row says two. The last row holds two jobs, so the answer is one.
Count the jobs that must fit. Using k equal to one gives two. Using k equal to two gives one. A, B, A, B has no idle slot.
The rows plus the last row must fit in n. So m minus one times cooldown plus one, plus k. Solve it for the cooldown, and round down.
The last row holds k jobs. Ties change the answer. Test two kinds with equal counts. Full breakdown in the lecture.